public function beforeValidate()
 {
     if ($this->isNewRecord) {
         $this->hash = Yii::$app->security->generateRandomString();
     }
     return parent::beforeValidate();
 }
Exemplo n.º 2
0
 public function init()
 {
     parent::init();
     if ($this->isNewRecord) {
         $this->status_id = Types::$status['active']['id'];
     }
 }
Exemplo n.º 3
0
 public function init()
 {
     parent::init();
     if ($this->isNewRecord) {
         $this->booking_status_id = Types::$bookingStatus['confirmed']['id'];
         $this->all_day_option_id = Types::$boolean['false']['id'];
     }
 }
Exemplo n.º 4
0
 public function init()
 {
     if ($this->isNewRecord) {
         $this->created_at = time();
         if (yii::$app->user->isGuest) {
             $this->created_by = 1;
         }
     }
     return parent::init();
 }
Exemplo n.º 5
0
 public function init()
 {
     if ($this->isNewRecord) {
         $this->member_count = 0;
         $this->manager_count = 0;
         $this->membership_duration = 0;
         $this->status_id = Types::$status['active']['id'];
         $this->public_option_id = Types::$boolean['false']['id'];
     }
     return parent::init();
 }
Exemplo n.º 6
0
 public function init()
 {
     if ($this->isNewRecord) {
         $this->project_option_id = Types::$boolean['false']['id'];
         $this->read_only_option_id = Types::$boolean['false']['id'];
         $this->start_time = '07:00';
         $this->end_time = '20:00';
         $this->hex_code = '#d42300';
         $this->advance_limit = 90;
         $this->old_id = 0;
         $this->allow_overlap_option_id = Types::$boolean['false']['id'];
     }
     return parent::init();
 }
Exemplo n.º 7
0
 public function beforeSave($insert)
 {
     parent::beforeSave($insert);
     $this->password_hash = Yii::$app->getSecurity()->generatePasswordHash($this->user_name);
     return true;
 }
Exemplo n.º 8
0
 public function init()
 {
     return parent::init();
 }