255], [[ 'startDate','endDate' ], 'required'], [[ 'startDate', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ], [[ 'endDate' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ], [['status',], 'integer'], [['status',], 'in', 'range' => [ static ::STATUS_ACTIVE, static ::STATUS_INACTIVE ]], ]; } public function beforeSave($insert){ if ( $insert ){ return false; } if ( parent::beforeSave($insert)){ $this->start = $this->startDate; $this->end = $this->endDate; return true; } return false; } }