Skip to content

Commit 6330d8a

Browse files
committed
Модель
1 parent 7feff83 commit 6330d8a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

models/Todo.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
use yupe\models\YModel;
3+
4+
/**
5+
* Class Todo
6+
*
7+
* @property integer $id
8+
* @property string $description
9+
* @property integer $status
10+
* @property integer $sort
11+
*/
12+
class Todo extends YModel
13+
{
14+
/**
15+
* @return string
16+
*/
17+
public function tableName()
18+
{
19+
return '{{todo}}';
20+
}
21+
22+
/**
23+
* @return array
24+
*/
25+
public function rules()
26+
{
27+
return [
28+
['description', 'required'],
29+
['description', 'length', 'max' => 255],
30+
['status, sort', 'numerical', 'integerOnly' => true],
31+
];
32+
}
33+
34+
/**
35+
* @return array
36+
*/
37+
public function attributeLabels()
38+
{
39+
return [
40+
'description' => 'Описание',
41+
'status' => 'Статус',
42+
'sort' => 'Сортировка',
43+
];
44+
}
45+
}

0 commit comments

Comments
 (0)