Advertisement
thatside_ua

CustomerRecord.php

Jan 17th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php
  2.  
  3. namespace app\models\customer;
  4.  
  5. use yii\db\ActiveRecord;
  6.  
  7. /**
  8.  * Class CustomerRecord
  9.  * @package app\models\customer
  10.  *
  11.  * @property string $name
  12.  * @property \DateTime $birth_date
  13.  * @property string $notes
  14.  * @property PhoneRecord[] $phones
  15.  */
  16. class CustomerRecord extends ActiveRecord {
  17.     public static function tableName() {
  18.         return 'customer';
  19.     }
  20.  
  21.     public function rules() {
  22.         return [
  23.             ['id', 'number'],
  24.             ['name', 'required'],
  25.             ['name', 'string', 'max' => 256],
  26.             ['birth_date', 'date', 'format' => 'dd.MM.yyyy'],
  27.             ['notes', 'safe']
  28.         ];
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement