Example #1
0
 public function preInsert($event)
 {
     $modified = $this->getModified();
     if (!array_key_exists('opened_at', $modified)) {
         $this->opened_at = date('Y-m-d H:i:s');
     }
     if (!array_key_exists('opened_by', $modified)) {
         $this->opened_by = Listener_Userstampable::getCurrentUserId();
     }
 }
 public function preInsert($event)
 {
     if (empty($this->created_at)) {
         $this->created_at = date('Y-m-d H:i:s');
     }
     if (empty($this->created_by)) {
         $this->created_by = Listener_Userstampable::getCurrentUserId();
     }
 }