| @@ 118-149 (lines=32) @@ | ||
| 115 | /** |
|
| 116 | * @inheritdoc |
|
| 117 | */ |
|
| 118 | public function behaviors() |
|
| 119 | { |
|
| 120 | return [ |
|
| 121 | [ |
|
| 122 | 'class' => HasProperties::className(), |
|
| 123 | ], |
|
| 124 | [ |
|
| 125 | 'class' => ActiveRecordHelper::className(), |
|
| 126 | ], |
|
| 127 | [ |
|
| 128 | 'class' => CleanRelations::className(), |
|
| 129 | ], |
|
| 130 | [ |
|
| 131 | 'class' => Tree::className(), |
|
| 132 | 'activeAttribute' => 'published', |
|
| 133 | 'sortOrder' => [ |
|
| 134 | 'sort_order' => SORT_ASC, |
|
| 135 | 'id' => SORT_ASC |
|
| 136 | ], |
|
| 137 | ], |
|
| 138 | [ |
|
| 139 | 'class' => TimestampBehavior::className(), |
|
| 140 | 'createdAtAttribute' => 'date_added', |
|
| 141 | 'updatedAtAttribute' => 'date_modified', |
|
| 142 | 'value' => new Expression('NOW()'), |
|
| 143 | 'attributes' => [ |
|
| 144 | ActiveRecord::EVENT_BEFORE_INSERT => ['date_added'], |
|
| 145 | ActiveRecord::EVENT_BEFORE_UPDATE => ['date_modified'], |
|
| 146 | ], |
|
| 147 | ], |
|
| 148 | ]; |
|
| 149 | } |
|
| 150 | ||
| 151 | ||
| 152 | /** |
|
| @@ 177-208 (lines=32) @@ | ||
| 174 | /** |
|
| 175 | * @inheritdoc |
|
| 176 | */ |
|
| 177 | public function behaviors() |
|
| 178 | { |
|
| 179 | return [ |
|
| 180 | [ |
|
| 181 | 'class' => Tree::className(), |
|
| 182 | 'activeAttribute' => 'active', |
|
| 183 | 'sortOrder' => [ |
|
| 184 | 'sort_order' => SORT_ASC, |
|
| 185 | 'id' => SORT_ASC |
|
| 186 | ], |
|
| 187 | ], |
|
| 188 | [ |
|
| 189 | 'class' => HasProperties::className(), |
|
| 190 | ], |
|
| 191 | [ |
|
| 192 | 'class' => \devgroup\TagDependencyHelper\ActiveRecordHelper::className(), |
|
| 193 | ], |
|
| 194 | [ |
|
| 195 | 'class' => CleanRelations::className(), |
|
| 196 | ], |
|
| 197 | [ |
|
| 198 | 'class' => TimestampBehavior::className(), |
|
| 199 | 'createdAtAttribute' => 'date_added', |
|
| 200 | 'updatedAtAttribute' => 'date_modified', |
|
| 201 | 'value' => new Expression('NOW()'), |
|
| 202 | 'attributes' => [ |
|
| 203 | ActiveRecord::EVENT_BEFORE_INSERT => ['date_added'], |
|
| 204 | ActiveRecord::EVENT_BEFORE_UPDATE => ['date_modified'], |
|
| 205 | ], |
|
| 206 | ], |
|
| 207 | ]; |
|
| 208 | } |
|
| 209 | ||
| 210 | /** |
|
| 211 | * Search products |
|
| @@ 88-119 (lines=32) @@ | ||
| 85 | /** @var FilterSets[] */ |
|
| 86 | private $filterSets = null; |
|
| 87 | ||
| 88 | public function behaviors() |
|
| 89 | { |
|
| 90 | return [ |
|
| 91 | [ |
|
| 92 | 'class' => HasProperties::className(), |
|
| 93 | ], |
|
| 94 | [ |
|
| 95 | 'class' => \devgroup\TagDependencyHelper\ActiveRecordHelper::className(), |
|
| 96 | ], |
|
| 97 | [ |
|
| 98 | 'class' => CleanRelations::className(), |
|
| 99 | ], |
|
| 100 | [ |
|
| 101 | 'class' => Tree::className(), |
|
| 102 | 'activeAttribute' => 'active', |
|
| 103 | 'sortOrder' => [ |
|
| 104 | 'sort_order' => SORT_ASC, |
|
| 105 | 'id' => SORT_ASC |
|
| 106 | ], |
|
| 107 | ], |
|
| 108 | [ |
|
| 109 | 'class' => TimestampBehavior::className(), |
|
| 110 | 'createdAtAttribute' => 'date_added', |
|
| 111 | 'updatedAtAttribute' => 'date_modified', |
|
| 112 | 'value' => new Expression('NOW()'), |
|
| 113 | 'attributes' => [ |
|
| 114 | ActiveRecord::EVENT_BEFORE_INSERT => ['date_added'], |
|
| 115 | ActiveRecord::EVENT_BEFORE_UPDATE => ['date_modified'], |
|
| 116 | ], |
|
| 117 | ], |
|
| 118 | ]; |
|
| 119 | } |
|
| 120 | ||
| 121 | /** |
|
| 122 | * Return delete modes list |
|