Advertisement
Guest User

Untitled

a guest
Jun 4th, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1.                 $transactionManager = new TransactionManager();
  2.                 $transaction = $transactionManager->get();
  3.  
  4.                 $customer = New Client();
  5.                 $customer->setTransaction($transaction);
  6.                 $customer->assign($this->request->getPost());
  7.                 $customer->save();
  8.  
  9.                 $clientContactType = new ClientContactsType();
  10.                 $clientContactType->setTransaction($transaction);
  11.                 $clientContactType->client = $customer;
  12.                 $clientContactType->name = 'Primary Account Holder';
  13.                 $clientContactType->description = '';
  14.  
  15.                 if($clientContactType->save($this->request->getPost())){
  16.                     $this->flash->success('Saved');
  17.                 } else {
  18.                     $this->flash->error($clientContactType->getMessages());
  19.                     $transaction->rollback('Transaction rolled back');
  20.  
  21.                 }
  22.  
  23.                 $transaction->commit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement