public function afterValidate() { if (empty($this->principal) && empty($this->secondary)) { $this->addError('principal', 'Please select at least one diagnosis'); } return parent::afterValidate(); }
public function preSave($event) { parent::preSave($event); $invoker = $event->getInvoker(); $vehicles = $invoker->getVehicles(); $invoker->setNumVehicles(count($vehicles)); }
public function afterValidate() { if (!empty($this->phrases)) { $has_phrases = false; foreach ($this->phrases as $phrase) { $phrase && ($has_phrases = true); } if (!$has_phrases) { $this->phrases = array(); } } if (!$this->match_correspondence && !$this->match_legacy_letters) { $this->addError('match_correspondence', 'Please select which type of letters you want to search'); } return parent::afterValidate(); }
/** * Construct the object * * @param void * @return null */ function __construct() { parent::__construct(); }
/** * 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 ReportPeer */ public function getPeer() { if (self::$peer === null) { self::$peer = new ReportPeer(); } return self::$peer; }