Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. class TestEmprendimiento extends CActiveRecord
  2. {
  3.     public function beforeSave() {
  4.         if (!parent::beforeSave())
  5.             return false;
  6.  
  7.         if ($this->isNewRecord)
  8.             $this->created_at = time();
  9.         else
  10.         $this->updated_at = time();
  11.  
  12.         return true;
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement