public function isValid($value)
    {
        if ($value instanceof ElectronicAddress) {
            $addressType = $value->getType();
            switch ($addressType) {
                case 'Email':
                    $addressValidator = $this->validatorResolver->createValidator('EmailAddress');
                break;
                default:
                    $addressValidator = $this->validatorResolver->createValidator('Neos.Party:' . $addressType . 'Address');
            }
            if ($addressValidator === null) {
                $this->addError('No validator found for electronic address of type "' . $addressType . '".', 1268676030);
            } else {
                $result = $addressValidator->validate($value->getIdentifier());
                if ($result->hasErrors()) {
                    $this->result = $result;
                }
            }
        }
    }
public function isValid($value)
    {
        if ($value instanceof ElectronicAddress) {
            $addressType = $value->getType();
            switch ($addressType) {
                case 'Email':
                    $addressValidator = $this->validatorResolver->createValidator('EmailAddress');
                break;
                default:
                    $addressValidator = $this->validatorResolver->createValidator('Neos.Party:' . $addressType . 'Address');
            }
            if ($addressValidator === null) {
                $this->addError('No validator found for electronic address of type "' . $addressType . '".', 1268676030);
            } else {
                $result = $addressValidator->validate($value->getIdentifier());
                if ($result->hasErrors()) {
                    $this->result = $result;
                }
            }
        }
    }
public function isValid ( $ value ) { if ( $ value instanceof ElectronicAddress ) { $ addressType = $ value -> getType ( ) ; switch ( $ addressType ) { case 'Email' : $ addressValidator = $ this -> validatorResolver -> createValidator ( 'EmailAddress' ) ; break ; default : $ addressValidator = $ this -> validatorResolver -> createValidator ( 'Neos.Party:' . $ addressType . 'Address' ) ; } if ( $ addressValidator === null ) { $ this -> addError ( 'No validator found for electronic address of type "' . $ addressType . '".' , 1268676030 ) ; } else { $ result = $ addressValidator -> validate ( $ value -> getIdentifier ( ) ) ; if ( $ result -> hasErrors ( ) ) { $ this -> result = $ result ; } } } }
Checks if the given value is a valid electronic address according to its type.

If at least one error occurred, the result is FALSE and any errors can
be retrieved through the getErrors() method.

@param mixed $value The value that should be validated
@return void
Checks if the given value is a valid electronic address according to its type .