protected function beforeSave() { //set the created date to allow auto deleting //http://docs.mongodb.org/manual/tutorial/expire-data/ $this->createdAt = new \MongoDate(); parent::beforeSave(); }
protected function beforeSave() { if (empty($this->created)) { $this->created = \Dsc\Mongo\Metastamp::getDate('now'); } if (empty($this->{'created.microtime'})) { $this->set('created.microtime', microtime(true)); } return parent::beforeSave(); }
/** * */ protected function beforeSave() { if (empty($this->created)) { $this->created = time(); } if (empty($this->visited) && !empty($this->last_visit)) { $this->visited = strtotime($this->last_visit); } elseif (empty($this->visited)) { $this->visited = time(); } if (empty($this->is_bot_last_checked) || $this->is_bot_last_checked < date('Y-m-d', strtotime('today'))) { $this->is_bot = (new \Activity\Lib\Excluded())->setActor($this)->isBot(); $this->is_bot_last_checked = time(); } return parent::beforeSave(); }
protected function beforeSave() { return parent::beforeSave(); }
protected function beforeSave() { $this->enabled = (int) $this->enabled; $this->requires_postal_code = (int) $this->requires_postal_code; return parent::beforeSave(); }