Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -60,12 +60,14 @@ abstract class AbstractComparisonValidator extends ConstraintValidator
|
|||
->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING | self::PRETTY_DATE))
|
||||
->setParameter('{{ compared_value }}', $this->formatValue($comparedValue, self::OBJECT_TO_STRING | self::PRETTY_DATE))
|
||||
->setParameter('{{ compared_value_type }}', $this->formatTypeOf($comparedValue))
|
||||
->setCode($this->getErrorCode())
|
||||
->addViolation();
|
||||
} else {
|
||||
$this->buildViolation($constraint->message)
|
||||
->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING | self::PRETTY_DATE))
|
||||
->setParameter('{{ compared_value }}', $this->formatValue($comparedValue, self::OBJECT_TO_STRING | self::PRETTY_DATE))
|
||||
->setParameter('{{ compared_value_type }}', $this->formatTypeOf($comparedValue))
|
||||
->setCode($this->getErrorCode())
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
|
@ -80,4 +82,13 @@ abstract class AbstractComparisonValidator extends ConstraintValidator
|
|||
* @return bool true if the relationship is valid, false otherwise
|
||||
*/
|
||||
abstract protected function compareValues($value1, $value2);
|
||||
|
||||
/**
|
||||
* Returns the error code used if the comparison fails.
|
||||
*
|
||||
* @return string|null The error code or `null` if no code should be set
|
||||
*/
|
||||
protected function getErrorCode()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue