/** * Returns the Field Rules, to validate users input * * @param type $rules * @return type */ public function getFieldRules($rules = array()) { $rules[] = array($this->profileField->internal_name, 'numerical'); if ($this->maxValue) { $rules[] = array($this->profileField->internal_name, 'numerical', 'max' => $this->maxValue); } if ($this->minValue) { $rules[] = array($this->profileField->internal_name, 'numerical', 'min' => $this->minValue); } return parent::getFieldRules($rules); }
/** * Returns the Field Rules, to validate users input * * @param type $rules * @return type */ public function getFieldRules($rules = array()) { $rules[] = array($this->profileField->internal_name, 'in', 'range' => array_keys($this->getSelectItems())); return parent::getFieldRules($rules); }
/** * Returns the Field Rules, to validate users input * * @param type $rules * @return type */ public function getFieldRules($rules = array()) { $rules[] = array($this->profileField->internal_name, 'safe'); return parent::getFieldRules($rules); }
/** * Returns the Field Rules, to validate users input * * @param type $rules * @return type */ public function getFieldRules($rules = array()) { if ($this->validator == self::VALIDATOR_EMAIL) { $rules[] = array($this->profileField->internal_name, 'email'); } elseif ($this->validator == self::VALIDATOR_URL) { $rules[] = array($this->profileField->internal_name, 'url'); } if ($this->maxLength == "" || $this->maxLength > 255) { $rules[] = array($this->profileField->internal_name, 'length', 'max' => 255); } else { $rules[] = array($this->profileField->internal_name, 'length', 'max' => $this->maxLength); } if ($this->minLength != "") { $rules[] = array($this->profileField->internal_name, 'length', 'min' => $this->minLength); } if ($this->regexp != "") { $errorMsg = $this->regexpErrorMessage; if ($errorMsg == "") { $errorMsg = "Invalid!"; } $rules[] = array($this->profileField->internal_name, 'match', 'pattern' => $this->regexp, 'message' => $errorMsg); } return parent::getFieldRules($rules); }
/** * Returns the Field Rules, to validate users input * * @param type $rules * @return type */ public function getFieldRules($rules = array()) { $rules[] = array($this->profileField->internal_name, 'date', 'format' => 'yyyy-MM-dd hh:mm:ss'); return parent::getFieldRules($rules); }