예제 #1
0
 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();
 }
예제 #2
0
파일: Logs.php 프로젝트: dioscouri/f3-lib
 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();
 }
예제 #3
0
 /**
  * 
  */
 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();
 }
예제 #4
0
 protected function beforeSave()
 {
     return parent::beforeSave();
 }
예제 #5
0
 protected function beforeSave()
 {
     $this->enabled = (int) $this->enabled;
     $this->requires_postal_code = (int) $this->requires_postal_code;
     return parent::beforeSave();
 }