protected function beforeValidate() { if (empty($this->slug) && !empty($this->title)) { $this->slug = $this->generateSlug(); } return parent::beforeValidate(); }
protected function beforeValidate() { if (empty($this->slug)) { $this->slug = \Web::instance()->slug($this->namespace); } $this->enabled = (bool) $this->enabled; return parent::beforeValidate(); }
/** * */ protected function beforeValidate() { if (empty($this->type)) { $this->type = $this->__type; } if (!$this->get('metadata.created')) { $this->set('metadata.created', \Dsc\Mongo\Metastamp::getDate('now')); } $this->set('metadata.last_modified', \Dsc\Mongo\Metastamp::getDate('now')); return parent::beforeValidate(); }
protected function beforeValidate() { $identity = \Dsc\System::instance()->get('auth')->getIdentity(); if (!$this->get('metadata.creator')) { if (!empty($identity->id)) { $this->set('metadata.creator', array('id' => $identity->id, 'name' => $identity->fullName())); } else { $this->set('metadata.creator', array('id' => new \MongoId(), 'name' => 'Unicorn Egg Eater')); } } if (!$this->get('metadata.created')) { $this->set('metadata.created', \Dsc\Mongo\Metastamp::getDate('now')); } $this->set('metadata.last_modified', \Dsc\Mongo\Metastamp::getDate('now')); if (!empty($identity->id)) { $this->set('metadata.last_modified_by', array('id' => $identity->id, 'name' => $identity->fullName())); } else { $this->set('metadata.last_modified_by', array('id' => new \MongoId(), 'name' => 'Unicorn Egg Eater')); } if (empty($this->type)) { $this->type = $this->type(); } return parent::beforeValidate(); }
protected function beforeValidate() { parent::beforeValidate(); }
public function beforeValidate() { $this->ancestorsBeforeValidate(); return parent::beforeValidate(); }