first commit
This commit is contained in:
47
common/models/News.php
Executable file
47
common/models/News.php
Executable file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
/**
|
||||
* This is the model class for table "news".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string|null $title
|
||||
* @property string|null $text
|
||||
* @property string|null $slug
|
||||
*/
|
||||
class News extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'news';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['text'], 'string'],
|
||||
[['title', 'slug'], 'string', 'max' => 255],
|
||||
[['slug'], 'unique'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'title' => 'Title',
|
||||
'text' => 'Text',
|
||||
'slug' => 'Slug',
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user