d8c1a2e0
Yarik
Big commit artbox
|
1
|
<?php
|
36d1807a
Yarik
Big commit.
|
2
3
|
namespace common\models;
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
4
|
|
d55d2fe0
Yarik
Multilanguage
|
5
6
7
8
|
use common\modules\language\behaviors\LanguageBehavior;
use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
use yii\web\Request;
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
9
|
|
d8c1a2e0
Yarik
Big commit artbox
|
10
|
/**
|
36d1807a
Yarik
Big commit.
|
11
|
* This is the model class for table "page".
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
12
13
|
* @property integer $id
* @property bool $in_menu
|
d55d2fe0
Yarik
Multilanguage
|
14
|
* * From language behavior *
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
15
16
17
18
19
|
* @property PageLang $lang
* @property PageLang[] $langs
* @property PageLang $object_lang
* @property string $ownerKey
* @property string $langKey
|
d55d2fe0
Yarik
Multilanguage
|
20
|
* @method string getOwnerKey()
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
21
|
* @method void setOwnerKey( string $value )
|
d55d2fe0
Yarik
Multilanguage
|
22
|
* @method string getLangKey()
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
23
|
* @method void setLangKey( string $value )
|
d55d2fe0
Yarik
Multilanguage
|
24
25
26
|
* @method ActiveQuery getLangs()
* @method ActiveQuery getLang( integer $language_id )
* @method PageLang[] generateLangs()
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
27
28
29
|
* @method void loadLangs( Request $request, ActiveRecord[] $model_langs )
* @method bool linkLangs( ActiveRecord[] $model_langs )
* @method bool saveLangs( ActiveRecord[] $model_langs )
|
d55d2fe0
Yarik
Multilanguage
|
30
|
* * End language behavior *
|
d8c1a2e0
Yarik
Big commit artbox
|
31
|
*/
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
32
|
class Page extends ActiveRecord
|
d8c1a2e0
Yarik
Big commit artbox
|
33
|
{
|
36d1807a
Yarik
Big commit.
|
34
|
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
35
36
|
public $title;
|
36d1807a
Yarik
Big commit.
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/**
* @inheritdoc
*/
public static function tableName()
{
return 'page';
}
/**
* @inheritdoc
*/
public function behaviors()
{
return [
|
d55d2fe0
Yarik
Multilanguage
|
51
52
53
|
'language' => [
'class' => LanguageBehavior::className(),
],
|
36d1807a
Yarik
Big commit.
|
54
55
56
57
58
59
60
61
62
63
|
];
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
64
65
66
67
|
[ 'title' ],
'safe',
],
[
|
36d1807a
Yarik
Big commit.
|
68
|
[
|
36d1807a
Yarik
Big commit.
|
69
70
71
72
73
74
75
|
'in_menu',
],
'boolean',
],
];
}
|
36d1807a
Yarik
Big commit.
|
76
77
78
79
80
81
|
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
|
824ca43a
Alexey Boroda
-Pages update (ad...
|
82
83
|
'id' => 'ID',
'in_menu' => 'Show in menu',
|
36d1807a
Yarik
Big commit.
|
84
85
|
];
}
|
d8c1a2e0
Yarik
Big commit artbox
|
86
|
}
|