public function initializeWithConstraints(array $constraints)
    {
        // Reset errors
        $this->errors = array();
        // Set existing constraint values to false
        foreach ($this->constraints as $constraint => $value) {
            $this->constraints[$constraint] = false;
        }
        // Initialize constraints with new values
        foreach ($constraints as $constraint => $value) {
            if (!isset($this->constraints[$constraint])) {
                throw new PropertyNotFound("The constraint '{$constraint}' is not valid for this validator.");
            }

            $this->constraints[$constraint] = $value;
        }
    }
public function initializeWithConstraints(array $constraints)
    {
        // Reset errors
        $this->errors = array();
        // Set existing constraint values to false
        foreach ($this->constraints as $constraint => $value) {
            $this->constraints[$constraint] = false;
        }
        // Initialize constraints with new values
        foreach ($constraints as $constraint => $value) {
            if (!isset($this->constraints[$constraint])) {
                throw new PropertyNotFound("The constraint '{$constraint}' is not valid for this validator.");
            }

            $this->constraints[$constraint] = $value;
        }
    }
public function initializeWithConstraints ( array $ constraints ) { // Reset errors $ this -> errors = array ( ) ; // Set existing constraint values to false foreach ( $ this -> constraints as $ constraint => $ value ) { $ this -> constraints [ $ constraint ] = false ; } // Initialize constraints with new values foreach ( $ constraints as $ constraint => $ value ) { if ( ! isset ( $ this -> constraints [ $ constraint ] ) ) { throw new PropertyNotFound ( "The constraint '{$constraint}' is not valid for this validator." ) ; } $ this -> constraints [ $ constraint ] = $ value ; } }
Initialized an instance of Validator, with earlier configured constraints.

@internal

@throws \eZ\Publish\API\Repository\Exceptions\PropertyNotFoundException

@param array $constraints
Initialized an instance of Validator with earlier configured constraints .