Blame view

common/models/Page.php 2.33 KB
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;
b569ac34   Eugeny Galkovskiy   MESSAGES !!!! EVGEN!
9
      use Yii;
5c2eb7c8   Yarik   Big commit almost...
10
      
d8c1a2e0   Yarik   Big commit artbox
11
      /**
36d1807a   Yarik   Big commit.
12
       * This is the model class for table "page".
c70f24ea   Yarik   For Leha commit.
13
       *
824ca43a   Alexey Boroda   -Pages update (ad...
14
15
       * @property integer    $id
       * @property bool       $in_menu
d55d2fe0   Yarik   Multilanguage
16
       * * From language behavior *
824ca43a   Alexey Boroda   -Pages update (ad...
17
18
       * @property PageLang   $lang
       * @property PageLang[] $langs
8af13427   Yarik   For leha commit.
19
       * @property PageLang   $objectLang
824ca43a   Alexey Boroda   -Pages update (ad...
20
21
       * @property string     $ownerKey
       * @property string     $langKey
8af13427   Yarik   For leha commit.
22
       * @property PageLang[] $modelLangs
72a992f5   Yarik   Import browser v1.0
23
       * @property bool       $transactionStatus
d55d2fe0   Yarik   Multilanguage
24
       * @method string           getOwnerKey()
824ca43a   Alexey Boroda   -Pages update (ad...
25
       * @method void             setOwnerKey( string $value )
d55d2fe0   Yarik   Multilanguage
26
       * @method string           getLangKey()
824ca43a   Alexey Boroda   -Pages update (ad...
27
       * @method void             setLangKey( string $value )
d55d2fe0   Yarik   Multilanguage
28
29
30
       * @method ActiveQuery      getLangs()
       * @method ActiveQuery      getLang( integer $language_id )
       * @method PageLang[]    generateLangs()
72a992f5   Yarik   Import browser v1.0
31
32
33
34
       * @method void             loadLangs( Request $request )
       * @method bool             linkLangs()
       * @method bool             saveLangs()
       * @method bool             getTransactionStatus()
d55d2fe0   Yarik   Multilanguage
35
       * * End language behavior *
d8c1a2e0   Yarik   Big commit artbox
36
       */
824ca43a   Alexey Boroda   -Pages update (ad...
37
      class Page extends ActiveRecord
d8c1a2e0   Yarik   Big commit artbox
38
      {
36d1807a   Yarik   Big commit.
39
          
824ca43a   Alexey Boroda   -Pages update (ad...
40
41
          public $title;
          
36d1807a   Yarik   Big commit.
42
43
44
45
46
47
48
49
50
51
52
53
54
55
          /**
           * @inheritdoc
           */
          public static function tableName()
          {
              return 'page';
          }
          
          /**
           * @inheritdoc
           */
          public function behaviors()
          {
              return [
d55d2fe0   Yarik   Multilanguage
56
57
58
                  'language' => [
                      'class' => LanguageBehavior::className(),
                  ],
36d1807a   Yarik   Big commit.
59
60
61
62
63
64
65
66
67
68
              ];
          }
          
          /**
           * @inheritdoc
           */
          public function rules()
          {
              return [
                  [
824ca43a   Alexey Boroda   -Pages update (ad...
69
70
71
72
                      [ 'title' ],
                      'safe',
                  ],
                  [
36d1807a   Yarik   Big commit.
73
                      [
36d1807a   Yarik   Big commit.
74
75
76
77
78
79
80
                          'in_menu',
                      ],
                      'boolean',
                  ],
              ];
          }
          
36d1807a   Yarik   Big commit.
81
82
83
84
85
86
          /**
           * @inheritdoc
           */
          public function attributeLabels()
          {
              return [
5c2eb7c8   Yarik   Big commit almost...
87
88
                  'id'      => Yii::t('app', 'id'),
                  'in_menu' => Yii::t('app', 'in_menu'),
36d1807a   Yarik   Big commit.
89
90
              ];
          }
d8c1a2e0   Yarik   Big commit artbox
91
      }