1 | <?php |
||
27 | class Item extends \yii\db\ActiveRecord |
||
28 | { |
||
29 | const STATUS_ACTIVE = 1; |
||
30 | const STATUS_INACTIVE = 0; |
||
31 | |||
32 | /** |
||
33 | * @inheritdoc |
||
34 | */ |
||
35 | 4 | public static function tableName() |
|
39 | |||
40 | /** |
||
41 | * @inheritdoc |
||
42 | */ |
||
43 | 1 | public function rules() |
|
54 | |||
55 | /** |
||
56 | * @inheritdoc |
||
57 | */ |
||
58 | public function attributeLabels() |
||
74 | |||
75 | /** |
||
76 | * @inheritdoc |
||
77 | */ |
||
78 | 4 | public function behaviors() |
|
89 | |||
90 | /** |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getUrl() |
||
97 | |||
98 | /** |
||
99 | * @return ItemCategory |
||
100 | */ |
||
101 | 1 | public function getItemCategory() |
|
107 | |||
108 | /** |
||
109 | * @return array |
||
110 | */ |
||
111 | 2 | public function getItemCategories() |
|
112 | { |
||
113 | 2 | $ids = explode(',', $this->categories); |
|
114 | 2 | $res = []; |
|
115 | 2 | foreach ($ids as $id) { |
|
116 | 2 | $res[] = ItemCategory::findOne($id); |
|
117 | } |
||
118 | 2 | return $res; |
|
119 | } |
||
120 | |||
121 | 1 | public function getItemCategoriesName() |
|
122 | { |
||
123 | 1 | $categories = $this->getItemCategories(); |
|
124 | 1 | $labels = []; |
|
125 | 1 | foreach ($categories as $category) { |
|
126 | 1 | $labels[] = $category->name; |
|
127 | } |
||
128 | 1 | return implode(',', $labels); |
|
129 | } |
||
130 | |||
131 | 1 | public static function getStatusList() |
|
138 | |||
139 | public function getImage() |
||
146 | |||
147 | 3 | public static function find() |
|
151 | |||
152 | 1 | public function beforeSave($insert) |
|
157 | |||
158 | 3 | public function afterFind() |
|
163 | } |
||
164 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.