Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Модель
  • Loading branch information
sabian committed Dec 6, 2015
1 parent 7feff83 commit 6330d8a
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions models/Todo.php
@@ -0,0 +1,45 @@
<?php
use yupe\models\YModel;

/**
* Class Todo
*
* @property integer $id
* @property string $description
* @property integer $status
* @property integer $sort
*/
class Todo extends YModel
{
/**
* @return string
*/
public function tableName()
{
return '{{todo}}';
}

/**
* @return array
*/
public function rules()
{
return [
['description', 'required'],
['description', 'length', 'max' => 255],
['status, sort', 'numerical', 'integerOnly' => true],
];
}

/**
* @return array
*/
public function attributeLabels()
{
return [
'description' => 'Описание',
'status' => 'Статус',
'sort' => 'Сортировка',
];
}
}

0 comments on commit 6330d8a

Please sign in to comment.