Permalink
Browse files

Модель

  • Loading branch information...
sabian committed Dec 6, 2015
1 parent 7feff83 commit 6330d8a7ec06a8dd86976b10514cce34df571ce0
Showing with 45 additions and 0 deletions.
  1. +45 −0 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.