/** * * Get the payment method (foreign record) in given record, or use default, if not set * @param Tinebase_Record_Abstract $record * @param unknown_type $fieldForeignId */ public function getPaymentMethodFromRecordOrDefault(Tinebase_Record_Abstract $record, $fieldForeignId) { if ($record->__get($fieldForeignId)) { return $record->getForeignRecord($fieldForeignId, $this); } return $this->getDefaultPaymentMethod(); }
/** * Append contacts by foreign key (record embedding) * * @param Tinebase_Record_Abstract $record * @return void */ protected function appendDependentRecords($record) { if ($record->__get('batch_dta_id')) { $this->appendForeignRecordToRecord($record, 'batch_dta_id', 'batch_dta_id', 'id', new Billing_Backend_BatchJobDta()); } if ($record->__get('open_item_id')) { $this->appendForeignRecordToRecord($record, 'open_item_id', 'open_item_id', 'id', new Billing_Backend_OpenItem()); } if ($record->__get('payment_id')) { $this->appendForeignRecordToRecord($record, 'payment_id', 'payment_id', 'id', new Billing_Backend_Payment()); } }
/** * gets record related properties * * @param string _name of property * @throws Tinebase_Exception_UnexpectedValue * @return mixed value of property */ public function __get($_name) { $result = parent::__get($_name); if ($_name === 'structure' && empty($result)) { $result = $this->_fetchStructure(); } return $result; }
/** * gets record related properties * * @param string _name of property * @throws Tinebase_Exception_UnexpectedValue * @return mixed value of property */ public function __get($_name) { $value = parent::__get($_name); switch ($_name) { case 'interval': return (int) $value > 1 ? (int) $value : 1; break; default: return $value; break; } }
/** * (non-PHPdoc) * @see Tinebase_Record_Abstract::__get() */ public function __get($_name) { if ($_name == 'method' && !$this->_properties['method'] && $this->_properties['ics']) { $this->getEvent(); } return parent::__get($_name); }