1 | <?php |
||
8 | class Queue extends ActiveRecord |
||
9 | { |
||
10 | /** |
||
11 | * @inheritdoc |
||
12 | */ |
||
13 | 2 | public static function tableName() |
|
17 | |||
18 | /** |
||
19 | * @inheritdoc |
||
20 | */ |
||
21 | 4 | public function behaviors() |
|
22 | { |
||
23 | return [ |
||
24 | 'timestamp' => [ |
||
25 | 4 | 'class' => TimestampBehavior::className(), |
|
26 | ] |
||
27 | ]; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @inheritdoc |
||
32 | */ |
||
33 | 1 | public function rules() |
|
34 | { |
||
35 | return [ |
||
36 | 1 | [['queue_id', 'catalog', 'name', 'description'], 'required'] |
|
37 | ]; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @inheritdoc |
||
42 | */ |
||
43 | 1 | public function attributeLabels() |
|
44 | { |
||
45 | return [ |
||
46 | 1 | 'id' => Yii::t('app/queue', 'ID'), |
|
47 | 1 | 'queue_id' => Yii::t('app/queue', '队列id'), |
|
48 | 1 | 'catalog' => Yii::t('app/queue', '类别'), |
|
49 | 1 | 'name' => Yii::t('app/queue', '任务名称'), |
|
50 | 1 | 'description' => Yii::t('app/queue', '详请信息'), |
|
51 | 1 | 'exec_time' => Yii::t('app/queue', '执行时间'), |
|
52 | 1 | 'status' => Yii::t('app/queue', '状态'), |
|
53 | 1 | 'created_at' => Yii::t('app/queue', '队列创建时间'), |
|
54 | 1 | 'updated_at' => Yii::t('app/queue', '队列修改时间'), |
|
55 | 1 | 'execution_time' => Yii::t('app/queue', '队列执行时间') |
|
56 | ]; |
||
57 | } |
||
58 | |||
59 | 1 | public function getExecutionTime() |
|
63 | |||
64 | public function getStatus($id) |
||
65 | { |
||
66 | if (Yii::$app->queue->isWaiting($id) || Yii::$app->queue->isReserved($id)) { |
||
75 | } |
||
76 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.