/
Ladlen
/
apple
Обзор
Документация
Войти
/
Ladlen
/
apple
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
common/models/db/Apple.php
59 строк
1 KB
dmitriy-dolgov
Apple => AppleFruit и небольшой багфиксинг
24 апр 2020, 07:47
24 апр 2020, 07:47
01c64c6
Код
Авторство
О чём код?
<?php namespace common\models\db; use Yii; /** * This is the model class for table "apple". * * @property int $id * @property int|null $user_id * @property string|null $apple_data JSON * * @property User $user */ class Apple extends \yii\db\ActiveRecord { /** * {@inheritdoc} */ public static function tableName() { return 'apple'; } /** * {@inheritdoc} */ public function rules() { return [ [['user_id'], 'integer'], [['apple_data'], 'string'], [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'user_id' => 'User ID', 'apple_data' => 'AppleFruit Data', ]; } /** * Gets query for [[User]]. * * @return \yii\db\ActiveQuery */ public function getUser() { return $this->hasOne(User::className(), ['id' => 'user_id']); } }