1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-02-15 03:11:58 +00:00
yii2-nomer/models/Link.php

51 lines
824 B
PHP
Raw Normal View History

2020-02-05 03:34:26 +00:00
<?php
namespace app\models;
use yii\db\ActiveRecord;
/**
* @property integer $id
* @property integer $user_id
* @property string $code
* @property User $user
*/
class Link extends ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'links';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['user_id'], 'integer'],
[['code'], 'string', 'max' => 255],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'user_id' => 'User ID',
'code' => 'Code',
];
}
public function getUser()
{
return $this->hasOne(User::className(), ['id' => 'user_id']);
}
}