Exemplo n.º 1
0
 protected function appendDependentRecords($record)
 {
     if ($record->__get('creditor_id')) {
         $creditor = Billing_Controller_Creditor::getInstance()->get($record->__get('creditor_id'));
         $record->__set('creditor_id', $creditor);
         //        	$creditor = Billing_Controller_Creditor::getInstance()->get($record->__get('creditor_id'));
         //    		$record->__set('creditor_id',$creditor);
         //    		$this->appendForeignRecordToRecord($record, 'creditor_id', 'creditor_id', 'id', new Billing_Backend_Creditor());
         //    		$creditor = $record->__get('creditor_id');
         //    		try{
         //    			if(is_object($creditor)){
         //    				$contactId = $creditor->__get('contact_id');
         //    			}else{
         //    				$contactId = $creditor->contact_id;
         //    			}
         //    			$contact = Addressbook_Controller_Contact::getInstance()->get($contactId);
         //    			if(is_object($creditor)){
         //    				$creditor->__set('contact_id',$contact->toArray());
         //    			}else{
         //    				$creditor->contact_id = $contact->toArray();
         //    			}
         //    		}catch(Exception $e){
         //    		}
         //			$record->__set('creditor_id',$creditor);
     }
     if ($record->__get('article_id')) {
         $this->appendForeignRecordToRecord($record, 'article_id', 'article_id', 'id', new Billing_Backend_Article());
         //$record->__set('article_id',$article);
     }
 }
Exemplo n.º 2
0
 /**
  * the singleton pattern
  *
  * @return SoEventManager_Controller_SoEvent
  */
 public static function getInstance()
 {
     if (self::$_instance === NULL) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Exemplo n.º 3
0
 protected function appendDependentRecords($record)
 {
     if ($record->__get('supply_order_id')) {
         $this->appendForeignRecordToRecord($record, 'supply_order_id', 'supply_order_id', 'id', new Billing_Backend_SupplyOrder());
         $supply_order = $record->__get('supply_order_id');
         try {
             if (is_object($supply_order)) {
                 $creditorId = $supply_order->__get('creditor_id');
             } else {
                 $creditorId = $supply_order->creditor_id;
             }
             $creditor = Billing_Controller_Creditor::getInstance()->get($creditorId);
             if (is_object($creditor)) {
                 $supply_order->__set('creditor_id', $creditor->toArray());
             } else {
                 $supply_order->creditor_id = $creditor->toArray();
             }
         } catch (Exception $e) {
         }
         $record->__set('supply_order_id', $supply_order);
     }
 }
Exemplo n.º 4
0
 public function saveCreditor($recordData)
 {
     return $this->_save($recordData, Billing_Controller_Creditor::getInstance(), 'Creditor');
 }