/
pashko
/
siec
Обзор
Документация
Войти
/
pashko
/
siec
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
spam
common/models/News.php
62 строки
1 KB
pash lenovo
news page with server API
29 окт 2019, 12:42
29 окт 2019, 12:42
5575db1
Код
Авторство
О чём код?
<?php namespace common\models; /** * This is the model class for table "news". * * @property int $id * @property string $image_id * @property string $text * @property int $timestamp * @property string $image_src */ class News extends \yii\db\ActiveRecord { function behaviors() { return [ /*'images' => [ 'class' => 'dvizh\gallery\behaviors\AttachImages', 'mode' => 'gallery', ]*/ ]; } /** * {@inheritdoc} */ public static function tableName() { return 'news'; } /** * {@inheritdoc} */ public function rules() { return [ [['image_id'], 'required'], [['text', 'shortcode'], 'string'], [['timestamp'], 'integer'], [['image_id'], 'string', 'max' => 20], [['image_src'], 'string', 'max' => 255], [['image_id'], 'unique'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'image_id' => 'Image ID', 'text' => 'Text', 'timestamp' => 'Timestamp', 'image_src' => 'Image Src', 'shortcode' => 'Код картинки' ]; } }