public function setValidator($validator)
    {
        if (!($validator instanceof AnDomainValidatorAbstract)) {
            if (is_string($validator) && strpos($validator, '.') === false) {
                $identifier = clone $this->getIdentifier();
                $identifier->path = array('domain','validator');
                $identifier->name = $validator;
            } else {
                $identifier = $this->getIdentifier($validator);
            }

            register_default(array('identifier' => $identifier, 'prefix' => $this->_repository->getClone()));

            $validator = $identifier;
        }

        $this->_validator = $validator;

        return $this;
    }
public function setValidator($validator)
    {
        if (!($validator instanceof AnDomainValidatorAbstract)) {
            if (is_string($validator) && strpos($validator, '.') === false) {
                $identifier = clone $this->getIdentifier();
                $identifier->path = array('domain','validator');
                $identifier->name = $validator;
            } else {
                $identifier = $this->getIdentifier($validator);
            }

            register_default(array('identifier' => $identifier, 'prefix' => $this->_repository->getClone()));

            $validator = $identifier;
        }

        $this->_validator = $validator;

        return $this;
    }
public function setValidator ( $ validator ) { if ( ! ( $ validator instanceof AnDomainValidatorAbstract ) ) { if ( is_string ( $ validator ) && strpos ( $ validator , '.' ) === false ) { $ identifier = clone $ this -> getIdentifier ( ) ; $ identifier -> path = array ( 'domain' , 'validator' ) ; $ identifier -> name = $ validator ; } else { $ identifier = $ this -> getIdentifier ( $ validator ) ; } register_default ( array ( 'identifier' => $ identifier , 'prefix' => $ this -> _repository -> getClone ( ) ) ) ; $ validator = $ identifier ; } $ this -> _validator = $ validator ; return $ this ; }
Method to set the validator.

@param mixed $validator Validator object. Can be an AnServiceIdentifier or string

@return AnDomainBehaviorValidatable
Method to set the validator .