Total Complexity | 4 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | class Product extends ActiveRecord |
||
17 | { |
||
18 | public function behaviors() |
||
19 | { |
||
20 | return [ |
||
21 | 'date' => [ |
||
22 | 'class' => TimestampBehavior::class, |
||
23 | 'createdAtAttribute' => 'created', |
||
24 | 'updatedAtAttribute' => 'updated', |
||
25 | 'value' => new Expression('NOW()'), |
||
26 | ], |
||
27 | ]; |
||
28 | } |
||
29 | |||
30 | public function rules() |
||
40 | ]; |
||
41 | } |
||
42 | |||
43 | public function getExampleArticle() { |
||
44 | return $this->hasOne(Article::class, [ |
||
45 | 'id' => 'example_article_id', |
||
46 | ]); |
||
47 | } |
||
48 | |||
49 | public static function tableName() |
||
52 | } |
||
53 | } |