@@ 33-67 (lines=35) @@ | ||
30 | /** |
|
31 | * {@inheritdoc} |
|
32 | */ |
|
33 | public function rules() |
|
34 | { |
|
35 | return ArrayHelper::merge(parent::rules(), [ |
|
36 | [ |
|
37 | 'albumId', |
|
38 | 'required', |
|
39 | ], |
|
40 | [ |
|
41 | 'albumId', |
|
42 | 'integer', |
|
43 | ], |
|
44 | [ |
|
45 | [ |
|
46 | 'albumId', |
|
47 | 'ownerId', |
|
48 | 'owner', |
|
49 | 'ownerAttribute', |
|
50 | ], |
|
51 | 'unique', |
|
52 | 'targetAttribute' => [ |
|
53 | 'albumId', |
|
54 | 'ownerId', |
|
55 | 'owner', |
|
56 | 'ownerAttribute', |
|
57 | ], |
|
58 | ], |
|
59 | [ |
|
60 | ['albumId'], |
|
61 | 'exist', |
|
62 | 'skipOnError' => true, |
|
63 | 'targetClass' => Album::class, |
|
64 | 'targetAttribute' => ['albumId' => 'id'], |
|
65 | ], |
|
66 | ]); |
|
67 | } |
|
68 | ||
69 | /** |
|
70 | * {@inheritdoc} |
@@ 33-67 (lines=35) @@ | ||
30 | /** |
|
31 | * {@inheritdoc} |
|
32 | */ |
|
33 | public function rules() |
|
34 | { |
|
35 | return ArrayHelper::merge(parent::rules(), [ |
|
36 | [ |
|
37 | 'mediafileId', |
|
38 | 'required', |
|
39 | ], |
|
40 | [ |
|
41 | 'mediafileId', |
|
42 | 'integer', |
|
43 | ], |
|
44 | [ |
|
45 | [ |
|
46 | 'mediafileId', |
|
47 | 'ownerId', |
|
48 | 'owner', |
|
49 | 'ownerAttribute', |
|
50 | ], |
|
51 | 'unique', |
|
52 | 'targetAttribute' => [ |
|
53 | 'mediafileId', |
|
54 | 'ownerId', |
|
55 | 'owner', |
|
56 | 'ownerAttribute', |
|
57 | ], |
|
58 | ], |
|
59 | [ |
|
60 | ['mediafileId'], |
|
61 | 'exist', |
|
62 | 'skipOnError' => true, |
|
63 | 'targetClass' => Mediafile::class, |
|
64 | 'targetAttribute' => ['mediafileId' => 'id'], |
|
65 | ], |
|
66 | ]); |
|
67 | } |
|
68 | ||
69 | /** |
|
70 | * {@inheritdoc} |