public function validateValue(Validatable $validateable) { $response = parent::validateValue($validateable); if ($response != null) { return $response; } if ($validateable->getValue() < $this->minimum || $validateable->getValue() > $this->maximum) { $response = new ValidationResponse($this->getKeyName()); $response->addValue('min', $this->minimum); $response->addValue('max', $this->maximum); return $response; } }
public function validateValue(Validatable $validateable) { //@todo don't call validate() like this $this->other->validate(); $oValidatable = new ValidatableFormComponentWrapper($this->other); if ($validateable->getValue() != $oValidatable->getValue()) { $response = new ValidationResponse($this->getKeyName(), $validateable->getValue()); $response->addValue('other', $this->other->getId()); return $response; } }
public function validateValue(Validatable $validateable) { $response = parent::validateValue($validateable); if ($response != null) { return $response; } if (preg_match("/" . $this->pattern . "/", $validateable->getValue()) != 1) { $response = new ValidationResponse($this->getKeyName(), $validateable->getValue()); $response->addValue('expression', $this->pattern); return $response; } }