public function __construct($pn_id = null) { parent::__construct($pn_id); # call superclass constructor }
function __construct($pn_id = null) { parent::__construct($pn_id); }
public function update($pa_options = null) { if (!trim($this->get('surname')) && !trim($this->get('forename'))) { $this->postError(1100, _t('Surname or forename must be set'), 'ca_entity_labels->insert()'); return false; } if (!$this->get('displayname')) { $this->set('displayname', trim(preg_replace('![ ]+!', ' ', $this->get('forename') . ' ' . $this->get('middlename') . ' ' . $this->get('surname')))); } return parent::update($pa_options); }
/** * Returns a peer instance associated with this om. * * Since Peer classes are not to have any instance attributes, this method returns the * same instance for all member of this class. The method could therefore * be static, but this would prevent one from overriding the behavior. * * @return LabelPeer */ public function getPeer() { if (self::$peer === null) { self::$peer = new LabelPeer(); } return self::$peer; }
public function update($pa_options = null) { if (!$this->get('displayname')) { $this->set('displayname', trim(preg_replace('![ ]+!', ' ', $this->get('forename') . ' ' . $this->get('middlename') . ' ' . $this->get('surname')))); } return parent::update($pa_options); }
public function update($pa_options = null) { if (!trim($this->get('surname')) && !trim($this->get('forename'))) { $this->postError(1100, _t('Surname or forename must be set'), 'ca_entity_labels->insert()'); return false; } if (($t_entity = caGetOption('subject', $pa_options, null)) && $t_entity->getTypeSetting('entity_class') == 'ORG') { $this->set('displayname', $this->get('surname')); } elseif (!$this->get('displayname')) { $this->set('displayname', trim(preg_replace('![ ]+!', ' ', $this->get('forename') . ' ' . $this->get('middlename') . ' ' . $this->get('surname')))); } return parent::update($pa_options); }