public function beforeValidate() { if (!$this->code) { $this->code = yupe\helpers\YText::translit($this->title); } return parent::beforeValidate(); }
public function beforeValidate() { if (!$this->slug) { $this->slug = yupe\helpers\YText::translit($this->name); } return parent::beforeValidate(); }
public function beforeValidate() { if ($this->attribute_option_id) { $option = AttributeOption::model()->findByPk($this->attribute_option_id); $this->attribute_value = $option ? $option->value : null; } if (!$this->attribute_value) { $this->addErrors(['attribute_value' => Yii::t('StoreModule.store', 'You must specify the attribute value')]); } return parent::beforeValidate(); }
/** * @return bool */ public function beforeValidate() { $settings = ['brands' => $this->brands, 'categories' => $this->categories, 'shop_name' => $this->shop_name, 'shop_company' => $this->shop_company, 'shop_url' => $this->shop_url, 'shop_platform' => $this->shop_platform, 'shop_version' => $this->shop_version, 'shop_agency' => $this->shop_agency, 'shop_email' => $this->shop_email, 'shop_cpa' => $this->shop_cpa]; $this->settings = json_encode($settings); return parent::beforeValidate(); }