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

            if ($identifier->path[1] != 'validator') {
                throw new AnControllerBehaviorException('Identifier: '.$identifier.' is not a validator identifier');
            }

            $validator = $identifier;
        }

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

            if ($identifier->path[1] != 'validator') {
                throw new AnControllerBehaviorException('Identifier: '.$identifier.' is not a validator identifier');
            }

            $validator = $identifier;
        }

        $this->_validator = $validator;
    }
public function setValidator ( $ validator ) { if ( ! ( $ validator instanceof LibBaseControllerValidatorAbstract ) ) { if ( is_string ( $ validator ) && strpos ( $ validator , '.' ) === false ) { $ identifier = clone $ this -> getIdentifier ( ) ; $ identifier -> path = array ( 'controller' , 'validator' ) ; $ identifier -> name = $ validator ; register_default ( array ( 'identifier' => $ identifier , 'prefix' => $ this ) ) ; } else { $ identifier = $ this -> getIdentifier ( $ validator ) ; } if ( $ identifier -> path [ 1 ] != 'validator' ) { throw new AnControllerBehaviorException ( 'Identifier: ' . $ identifier . ' is not a validator identifier' ) ; } $ validator = $ identifier ; } $ this -> _validator = $ validator ; }
Sets the validator.

@param string $validator
Sets the validator .