public function setAttributes($values, $safeOnly = true) { if ($this->type == 'dynamic') { $this->criteriaInput = array(); foreach (array('attribute', 'comparison', 'value') as $property) { if (isset($values[$property])) { $this->criteriaInput[$property] = $values[$property]; } } } parent::setAttributes($values, $safeOnly); }
public function setAttributes($values, $safeOnly = true) { if ($this->type == 'dynamic') { $this->criteriaInput = array(); foreach (array('attribute', 'comparison', 'value') as $property) { if (isset($values[$property])) { $this->criteriaInput[$property] = $values[$property]; } } $criteria = array_combine($this->criteriaInput['attribute'], $this->criteriaInput['value']); if (array_key_exists('tags', $criteria) && empty($criteria['tags'])) { $this->addError('tags', Yii::t('contacts', 'Tag list must be non-empty')); } } parent::setAttributes($values, $safeOnly); }