/** * Value can either be a string or if dynamic step, then it is an integer * @return bool */ public function validateValue() { if (parent::validateValue()) { if ($this->type == self::TYPE_STATIC) { $validator = CValidator::createValidator('type', $this, 'value', array('type' => 'string')); $validator->validate($this); return !$this->hasErrors(); } else { $validator = CValidator::createValidator('type', $this, 'alternateValue', array('type' => 'integer')); $validator->allowEmpty = false; $validator->validate($this); return !$this->hasErrors(); } } return false; }
/** * Override to make sure the value attribute is set as an array. */ public function rules() { return array_merge(parent::rules(), array(array('value', 'type', 'type' => 'array'))); }