diff --git a/models/Customer.php b/models/Customer.php index bb8156d..34db3fe 100644 --- a/models/Customer.php +++ b/models/Customer.php @@ -30,11 +30,24 @@ */ class Customer extends ActiveRecord implements IdentityInterface { - const STATUS_ACTIVE = 10; const STATUS_DELETED = 0; const GENDER_MALE = 1; const GENDER_FEMALE = 2; + + public function getBirthDate() + { + if (empty($this->birthday)) { + return ''; + } else { + return date('d.m.Y', $this->birthday); + } + } + + public function setBirthDate($value) + { + $this->birthday = strtotime($value); + } /** * @inheritdoc @@ -68,6 +81,10 @@ 'required', ], [ + [ 'birthDate' ], + 'safe', + ], + [ [ 'status', 'gender', -- libgit2 0.21.4