/
Ladlen
/
news2
Обзор
Документация
Войти
/
Ladlen
/
news2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
models/News.php
61 строка
1 KB
Dolgov Dmitriy
article
11 июн 2017, 21:04
11 июн 2017, 21:04
ee5406d
Код
Авторство
О чём код?
<?php namespace app\models; use Yii; use yii\behaviors\TimestampBehavior; /** * This is the model class for table "news". * * @property integer $id * @property string $title * @property string $body * @property integer $created_at * @property integer $updated_at */ class News extends \yii\db\ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'news'; } /** * @inheritdoc */ public function rules() { return [ [['body'], 'string', 'min' => 1], //[['created_at'], 'required'], [['created_at', 'updated_at'], 'integer'], [['title'], 'string', 'max' => 255, 'min' => 1], ]; } /** @inheritdoc */ public function behaviors() { return [ TimestampBehavior::className(), ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => Yii::t('app', 'ID'), 'title' => Yii::t('app', 'Title'), 'body' => Yii::t('app', 'Body'), 'created_at' => Yii::t('app', 'Created At'), 'updated_at' => Yii::t('app', 'Updated At'), ]; } }