Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Code'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "code"]], "cond_type" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Condition type'), "isRequired" => true, "showInGrid" => false, "data" => ["\\app\\modules\\main\\models\\Template", "getConds"]], "params" => [$this->owner, "cond_type"]], "cond" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Condition'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "cond"]], "sort" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Sort'), "defaultValue" => ActiveRecord::DEFAULT_SORT, "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "sort"]], "includesIdsStr" => ["definition" => ["class" => \common\db\fields\ManyManySortField::className(), "title" => Yii::t('main/app', 'Includes'), "data" => [$this, "getIncludesList"]], "params" => [$this->owner, "includesIdsStr", "includes"]]];
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function config()
 {
     return ["parent_id" => ["definition" => ["class" => \common\db\fields\ParentListField::className(), "title" => Yii::t('main/app', 'Parent'), "data" => [$this->owner, "getListTreeData"]], "params" => [$this->owner, "parent_id"]], "title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\CodeField::className(), "title" => Yii::t('main/app', 'Code'), "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "code"]], "link" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Link'), "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "link"]], "class" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Css class'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "class"]], "target" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Target'), "isRequired" => false, "showInGrid" => false, "data" => function () {
         return $this->owner->targetsList();
     }], "params" => [$this->owner, "target"]]];
 }
Ejemplo n.º 3
0
 /**
  * Поиск
  * @param ActiveQuery $query запрос
  */
 protected function search(ActiveQuery $query)
 {
     parent::search($query);
     if ($this->eagerLoading) {
         $query->with($this->relation);
     }
 }
Ejemplo n.º 4
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["order_id" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Order ID'), "isRequired" => true], "params" => [$this->owner, "order_id"]], "title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Title')], "params" => [$this->owner, "title"]], "price" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Price'), "isRequired" => true], "params" => [$this->owner, "price"]], "discount" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Discount')], "params" => [$this->owner, "discount"]], "qty" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Quantity'), "isRequired" => true], "params" => [$this->owner, "qty"]], "item_id" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Item ID'), "isRequired" => true], "params" => [$this->owner, "item_id"]], "item_class" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('shop/app', 'Item class'), "isRequired" => true, 'data' => [Yii::$app->getModule('shop'), 'getModelNames']], "params" => [$this->owner, "item_class"]], "link" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Link'), "showInGrid" => false], "params" => [$this->owner, "link"]], "attrs" => ["definition" => ["class" => \app\modules\shop\db\fields\GoodAttrsField::className(), "title" => Yii::t('shop/app', 'Attributes')], "params" => [$this->owner, "attrs"]], "client_attrs" => ["definition" => ["class" => \app\modules\shop\db\fields\GoodAttrsField::className(), "title" => Yii::t('shop/app', 'Client Attributes')], "params" => [$this->owner, "client_attrs"]]];
 }
Ejemplo n.º 5
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Title'), "isRequired" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Code'), "isRequired" => true], "params" => [$this->owner, "code"]], "cond_type" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Condition type'), "isRequired" => true, "showInGrid" => false, "data" => [$this->owner, "getConds"]], "params" => [$this->owner, "cond_type"]], "cond" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Condition'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "cond"]], "sort" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('main/app', 'Sort'), "defaultValue" => ActiveRecord::DEFAULT_SORT, "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "sort"]], "text" => ["definition" => ["class" => \common\db\fields\HtmlField::className(), "title" => Yii::t('main/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]]];
 }
Ejemplo n.º 6
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('banners/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "place_id" => ["definition" => ["class" => \common\db\fields\HasOneField::className(), "title" => Yii::t('banners/app', 'Place'), "data" => [$this, "getPlaces"], "isRequired" => true], "params" => [$this->owner, "place_id", "place"]], "cond_type" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('banners/app', 'Condition type'), "isRequired" => true, "showInGrid" => false, "data" => [$this->owner, "getConds"]], "params" => [$this->owner, "cond_type"]], "cond" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('banners/app', 'Condition'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "cond"]], "image" => ["definition" => ["class" => \common\db\fields\Html5FileField::className(), "title" => Yii::t('banners/app', 'File')], "params" => [$this->owner, "image"]], "link" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('banners/app', 'Link'), "showInGrid" => false], "params" => [$this->owner, "link"]], "target" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('banners/app', 'Target'), "showInGrid" => false, "data" => ["\\app\\modules\\banners\\models\\Banner", "getTargets"]], "params" => [$this->owner, "target"]], "text" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('banners/app', 'Text')], "params" => [$this->owner, "text"]], "width" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('banners/app', 'Width'), "showInGrid" => false], "params" => [$this->owner, "width"]], "height" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('banners/app', 'Height'), "showInGrid" => false], "params" => [$this->owner, "height"]], "sort" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('banners/app', 'Sort'), "showInGrid" => true, "editInGrid" => true], "params" => [$this->owner, "sort"]]];
 }
Ejemplo n.º 7
0
 /**
  * @inheritdoc
  */
 public function config()
 {
     return ["role" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Role'), "isRequired" => true, "data" => [$this->owner, "getRolesNames"]], "params" => [$this->owner, "role"]], "username" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Username'), "isRequired" => true], "params" => [$this->owner, "username"]], "password" => ["definition" => ["class" => \common\db\fields\PasswordField::className(), "title" => Yii::t('main/app', 'Password'), "isRequired" => false, "showInGrid" => false, "showInView" => false], "params" => [$this->owner, "password"]], "confirm_password" => ["definition" => ["class" => \common\db\fields\PasswordField::className(), "title" => Yii::t('main/app', 'Confirm password'), "isRequired" => false, "showInGrid" => false, "showInView" => false], "params" => [$this->owner, "confirm_password"]], "email" => ["definition" => ["class" => \common\db\fields\EmailField::className(), "title" => Yii::t('main/app', 'Email'), "isRequired" => true], "params" => [$this->owner, "email"]], "name" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Name'), "isRequired" => false], "params" => [$this->owner, "name"]], "image" => ["definition" => ["class" => \common\db\fields\Html5ImageField::className(), "title" => Yii::t('main/app', 'Image'), "isRequired" => false], "params" => [$this->owner, "image"]], "text" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('main/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]], "auth_key" => ["definition" => ["class" => \common\db\fields\Field::className(), "title" => Yii::t('main/app', 'Api key'), "isRequired" => false, "showInForm" => false, "showInGrid" => false, "showInExtendedFilter" => false, "isSafe" => false], "params" => [$this->owner, "auth_key"]]];
 }
Ejemplo n.º 8
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["model" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Model class'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "model"]], "role" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Role'), "isRequired" => true, "data" => function () {
         return \app\modules\main\models\User::getRolesNames();
     }, "editInGrid" => true], "params" => [$this->owner, "role"]], "create" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Create'), "editInGrid" => true], "params" => [$this->owner, "create"]], "read" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Read'), "editInGrid" => true], "params" => [$this->owner, "read"]], "update" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Update'), "editInGrid" => true], "params" => [$this->owner, "update"]], "delete" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Delete'), "editInGrid" => true], "params" => [$this->owner, "delete"]], "constraint" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Constraint class'), "editInGrid" => true], "params" => [$this->owner, "constraint"]], "forbidden_attrs" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('main/app', 'Forbidden attributes'), "editInGrid" => true], "params" => [$this->owner, "forbidden_attrs"]]];
 }