/** * @param ElementInterface $elementInstance * @return bool */ public function isValid(ElementInterface $elementInstance) { if (filter_var($elementInstance->getValue(), FILTER_VALIDATE_EMAIL)) { return TRUE; } return FALSE; }
/** * @param ElementInterface $elementInstance * * @return bool */ public function isValid(ElementInterface $elementInstance) { $value = $elementInstance->getValue(); if (strlen($value) > $this->_getLength()) { return FALSE; } return TRUE; }
/** * @param ElementInterface $elementInstance * * @return bool */ public function isValid(ElementInterface $elementInstance) { $value = strtolower($elementInstance->getValue()); if (preg_match($this->_getRegExpValue(), $value) === 0) { return FALSE; } return TRUE; }
/** * @param ElementInterface $elementInstance * * @return bool */ public function isValid(ElementInterface $elementInstance) { $value = $elementInstance->getValue(); if (strcasecmp($value, $this->_getMatchValue()) !== 0) { return FALSE; } return TRUE; }
/** * @param ElementInterface $elementInstance * * @return bool */ public function isValid(ElementInterface $elementInstance) { $value = $elementInstance->getValue(); $matchElementValue = $this->_getMatchElement()->getValue(); if ($value !== $matchElementValue || $elementInstance->isValid() === FALSE) { return FALSE; } return TRUE; }
/** * @param ElementInterface $elementInstance * * @return bool */ public function isValid(ElementInterface $elementInstance) { // ---------------------------------- // fields with inmutable values if ($elementInstance instanceof ElementCheckboxField) { if ($elementInstance->hasCheckedOptions() === FALSE) { return FALSE; } return TRUE; } // ---------------------------------- // fields with actual mutable values $value = $elementInstance->getValue(); if (empty($value)) { return FALSE; } return TRUE; }
/** * @param ElementInterface $elementInstance * * @return string */ public function renderErrorMessage(ElementInterface $elementInstance) { $parsedFieldPlaceholders = $elementInstance->parseFieldPlaceholders($this->getErrorMessage()); return $this->_parseConditionPlaceholders($parsedFieldPlaceholders); }