6fc55685
Anastasia
add logo in admin
|
1
2
3
4
|
<?php
namespace common\models;
|
04e48022
Anastasia
add partnebrs to ...
|
5
|
use artbox\core\models\Image;
|
6fc55685
Anastasia
add logo in admin
|
6
7
8
9
10
|
use Yii;
/**
* This is the model class for table "logo".
*
|
04e48022
Anastasia
add partnebrs to ...
|
11
12
|
* @property int $id
* @property int $image_id
|
6fc55685
Anastasia
add logo in admin
|
13
|
* @property string $link
|
04e48022
Anastasia
add partnebrs to ...
|
14
|
* @property int $sort
|
6fc55685
Anastasia
add logo in admin
|
15
16
17
18
19
20
21
22
23
24
|
*/
class Logo extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'logo';
}
|
04e48022
Anastasia
add partnebrs to ...
|
25
|
|
6fc55685
Anastasia
add logo in admin
|
26
27
28
29
30
31
|
/**
* {@inheritdoc}
*/
public function rules()
{
return [
|
04e48022
Anastasia
add partnebrs to ...
|
32
33
34
|
[ [ 'image_id', 'sort'], 'default', 'value' => null],
[ [ 'image_id', 'sort'], 'integer'],
[ [ 'link'], 'string'],
|
6fc55685
Anastasia
add logo in admin
|
35
36
|
];
}
|
04e48022
Anastasia
add partnebrs to ...
|
37
|
|
6fc55685
Anastasia
add logo in admin
|
38
39
40
41
42
43
|
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
|
04e48022
Anastasia
add partnebrs to ...
|
44
|
'id' => Yii::t('app', 'ID'),
|
6fc55685
Anastasia
add logo in admin
|
45
|
'image_id' => Yii::t('app', 'Image ID'),
|
04e48022
Anastasia
add partnebrs to ...
|
46
47
|
'link' => Yii::t('app', 'Link'),
'sort' => Yii::t('app', 'Sort'),
|
6fc55685
Anastasia
add logo in admin
|
48
49
|
];
}
|
04e48022
Anastasia
add partnebrs to ...
|
50
51
52
53
54
|
public function getImage()
{
return $this->hasOne(Image::class, [ 'id' => 'image_id' ]);
}
|
6fc55685
Anastasia
add logo in admin
|
55
|
}
|