1 | <?php |
||
21 | class Page extends \yii\db\ActiveRecord |
||
22 | { |
||
23 | const STATUS_INACTIVE = 0; |
||
24 | const STATUS_ACTIVE = 1; |
||
25 | |||
26 | /** |
||
27 | * @inheritdoc |
||
28 | */ |
||
29 | 1 | public static function tableName() |
|
33 | |||
34 | /** |
||
35 | * @inheritdoc |
||
36 | */ |
||
37 | 1 | public function rules() |
|
38 | { |
||
39 | return [ |
||
40 | 1 | [['title', 'slug'], 'required'], |
|
41 | 1 | [['status', 'created_at', 'updated_at'], 'integer'], |
|
42 | 1 | [['content'], 'string'], |
|
43 | 1 | [['title', 'slug'], 'string', 'max' => 255], |
|
44 | 1 | ]; |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | public function attributeLabels() |
||
51 | { |
||
52 | return [ |
||
53 | 'id' => 'ID', |
||
54 | 'title' => '标题', |
||
55 | 'slug' => '别名', |
||
56 | 'status' => '状态', |
||
57 | 'content' => '内容', |
||
58 | 'created_at' => '创建时间', |
||
59 | 'updated_at' => '更新时间', |
||
60 | ]; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | 1 | public function behaviors() |
|
67 | { |
||
68 | return [ |
||
69 | 'timestamp' => [ |
||
70 | 1 | 'class' => TimestampBehavior::className(), |
|
|
|||
71 | 1 | ], |
|
72 | 'fileBehavior' => [ |
||
73 | 1 | 'class' => \nemmo\attachments\behaviors\FileBehavior::className() |
|
74 | 1 | ], |
|
75 | 1 | ]; |
|
76 | } |
||
77 | |||
78 | 1 | public static function getStatusList() |
|
79 | { |
||
80 | return [ |
||
81 | 1 | self::STATUS_INACTIVE => '隐藏', |
|
82 | 1 | self::STATUS_ACTIVE => '显示', |
|
83 | 1 | ]; |
|
84 | } |
||
85 | |||
86 | public function getUrl() |
||
90 | |||
91 | public function getImage() |
||
98 | } |
||
99 |
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.