@@ 16-40 (lines=25) @@ | ||
13 | * @method static Item|null findOne($condition) |
|
14 | * @method static Item[] findAll($condition) |
|
15 | */ |
|
16 | class Item extends ActiveRecord |
|
17 | { |
|
18 | /** |
|
19 | * @inheritdoc |
|
20 | */ |
|
21 | public function behaviors() |
|
22 | { |
|
23 | return [ |
|
24 | [ |
|
25 | 'class' => JsonBehavior::className(), |
|
26 | 'attributes' => ['params'], |
|
27 | ] |
|
28 | ]; |
|
29 | } |
|
30 | ||
31 | /** |
|
32 | * @inheritdoc |
|
33 | */ |
|
34 | public function rules() |
|
35 | { |
|
36 | return [ |
|
37 | [['params'], JsonValidator::className()], |
|
38 | ]; |
|
39 | } |
|
40 | } |
@@ 16-48 (lines=33) @@ | ||
13 | * @method static Item|null findOne($condition) |
|
14 | * @method static Item[] findAll($condition) |
|
15 | */ |
|
16 | class ItemMerge extends ActiveRecord |
|
17 | { |
|
18 | /** |
|
19 | * @inheritdoc |
|
20 | */ |
|
21 | public static function tableName() |
|
22 | { |
|
23 | return '{{%item}}'; |
|
24 | } |
|
25 | ||
26 | /** |
|
27 | * @inheritdoc |
|
28 | */ |
|
29 | public function behaviors() |
|
30 | { |
|
31 | return [ |
|
32 | [ |
|
33 | 'class' => JsonBehavior::className(), |
|
34 | 'attributes' => ['params'], |
|
35 | ] |
|
36 | ]; |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * @inheritdoc |
|
41 | */ |
|
42 | public function rules() |
|
43 | { |
|
44 | return [ |
|
45 | [['params'], JsonValidator::className(), 'merge' => true], |
|
46 | ]; |
|
47 | } |
|
48 | } |