예제 #1
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['productListingSortId'], 'integer'], ['productListingSortId', 'default', 'value' => 1], ['productListingSortId', 'in', 'range' => array_keys(ProductListingSort::enabledSorts())], ['listViewType', 'default', 'value' => Yii::$app->getModule('shop')->listViewType], ['listViewType', 'in', 'range' => ['listView', 'blockView'], 'strict' => true], ['productsPerPage', 'default', 'value' => Yii::$app->getModule('shop')->productsPerPage], ['productsPerPage', 'integer', 'max' => 50], ['userCurrency', 'default', 'value' => CurrencyHelper::getMainCurrency()->iso_code], ['userCurrency', 'in', 'range' => Currency::getIsoCodes(), 'strict' => true]];
 }