1 | <?php |
||
24 | class News extends \yii\db\ActiveRecord |
||
25 | { |
||
26 | const STATUS_BLOCKED = 0; |
||
27 | const STATUS_ACTIVE = 1; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | public $tagValues; |
||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | public $gallery; |
||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | public $galleryTitles; |
||
41 | |||
42 | 28 | public function __construct($config = []) |
|
47 | |||
48 | /** |
||
49 | * @inheritdoc |
||
50 | */ |
||
51 | 28 | public static function tableName() |
|
55 | |||
56 | /** |
||
57 | * @inheritdoc |
||
58 | */ |
||
59 | 7 | public function rules() |
|
90 | |||
91 | /** |
||
92 | * @inheritdoc |
||
93 | */ |
||
94 | 26 | public function attributeLabels() |
|
112 | |||
113 | /** |
||
114 | * @inheritdoc |
||
115 | */ |
||
116 | 5 | public function attributeHints() |
|
122 | |||
123 | /** |
||
124 | * @inheritdoc |
||
125 | */ |
||
126 | 28 | public function behaviors() |
|
145 | |||
146 | 3 | public function transactions() |
|
154 | |||
155 | /** |
||
156 | * @inheritdoc |
||
157 | */ |
||
158 | public function beforeSave($insert) |
||
168 | |||
169 | /** |
||
170 | * @inheritdoc |
||
171 | * @return NewsQuery |
||
172 | */ |
||
173 | 27 | public static function find() |
|
177 | |||
178 | /** |
||
179 | * Get all statuses |
||
180 | * |
||
181 | * @return string[] |
||
182 | */ |
||
183 | 26 | public static function getStatuses() |
|
190 | |||
191 | /** |
||
192 | * Get statuse name |
||
193 | * |
||
194 | * @return string |
||
195 | */ |
||
196 | 25 | public function getStatusName() |
|
201 | |||
202 | /** |
||
203 | * Is it blocked? |
||
204 | * |
||
205 | * @param bool |
||
206 | */ |
||
207 | 1 | public function isBlocked() |
|
211 | |||
212 | /** |
||
213 | * Is it active? |
||
214 | * |
||
215 | * @param bool |
||
216 | */ |
||
217 | 1 | public function isActive() |
|
221 | |||
222 | /** |
||
223 | * @return \yii\db\ActiveQuery |
||
224 | */ |
||
225 | 25 | public function getType() |
|
229 | |||
230 | /** |
||
231 | * Get tags. |
||
232 | * |
||
233 | * @return \yii\db\ActiveQuery |
||
234 | */ |
||
235 | 3 | public function getTags() |
|
241 | |||
242 | public function getFiles($callable = null) |
||
248 | } |
||
249 |