protected function _setValidator($validator)
    {
        if (!is_null($validator) && !($validator instanceof ValidatorInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid validator'), null, null, $validator);
        }

        $this->validator = $validator;
    }
protected function _setValidator($validator)
    {
        if (!is_null($validator) && !($validator instanceof ValidatorInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid validator'), null, null, $validator);
        }

        $this->validator = $validator;
    }
protected function _setValidator ( $ validator ) { if ( ! is_null ( $ validator ) && ! ( $ validator instanceof ValidatorInterface ) ) { throw $ this -> _createInvalidArgumentException ( $ this -> __ ( 'Invalid validator' ) , null , null , $ validator ) ; } $ this -> validator = $ validator ; }
Assigns a validator to this instance.

@since [*next-version*]

@param ValidatorInterface|null $validator The validator.
Assigns a validator to this instance .