Beispiel #1
0
 /**
  * @param ElementInterface $elementInstance
  * @return bool
  */
 public function isValid(ElementInterface $elementInstance)
 {
     if (filter_var($elementInstance->getValue(), FILTER_VALIDATE_EMAIL)) {
         return TRUE;
     }
     return FALSE;
 }
Beispiel #2
0
 /**
  * @param ElementInterface $elementInstance
  *
  * @return bool
  */
 public function isValid(ElementInterface $elementInstance)
 {
     $value = $elementInstance->getValue();
     if (strlen($value) > $this->_getLength()) {
         return FALSE;
     }
     return TRUE;
 }
Beispiel #3
0
 /**
  * @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;
 }
Beispiel #4
0
 /**
  * @param ElementInterface $elementInstance
  *
  * @return bool
  */
 public function isValid(ElementInterface $elementInstance)
 {
     $value = $elementInstance->getValue();
     if (strcasecmp($value, $this->_getMatchValue()) !== 0) {
         return FALSE;
     }
     return TRUE;
 }
Beispiel #5
0
 /**
  * @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;
 }
Beispiel #6
0
 /**
  * @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;
 }
Beispiel #7
0
 /**
  * @param ElementInterface $elementInstance
  *
  * @return string
  */
 public function renderErrorMessage(ElementInterface $elementInstance)
 {
     $parsedFieldPlaceholders = $elementInstance->parseFieldPlaceholders($this->getErrorMessage());
     return $this->_parseConditionPlaceholders($parsedFieldPlaceholders);
 }