public function attach(ValidatorInterface $validator,
                           $showMessages = true,
                           $leadingTemplate = null,
                           $trailingTemplate = null,
                           $priority = self::DEFAULT_PRIORITY)
    {
        $this->validators->insert(
            array(
                'instance' => $validator,
                'show_messages' => (bool)$showMessages,
                'leading_message_template' => $leadingTemplate,
                'trailing_message_template' => $trailingTemplate,
            ),
            $priority
        );
        return $this;
    }
public function attach(ValidatorInterface $validator,
                           $showMessages = true,
                           $leadingTemplate = null,
                           $trailingTemplate = null,
                           $priority = self::DEFAULT_PRIORITY)
    {
        $this->validators->insert(
            array(
                'instance' => $validator,
                'show_messages' => (bool)$showMessages,
                'leading_message_template' => $leadingTemplate,
                'trailing_message_template' => $trailingTemplate,
            ),
            $priority
        );
        return $this;
    }
public function attach ( ValidatorInterface $ validator , $ showMessages = true , $ leadingTemplate = null , $ trailingTemplate = null , $ priority = self :: DEFAULT_PRIORITY ) { $ this -> validators -> insert ( array ( 'instance' => $ validator , 'show_messages' => ( bool ) $ showMessages , 'leading_message_template' => $ leadingTemplate , 'trailing_message_template' => $ trailingTemplate , ) , $ priority ) ; return $ this ; }
Attaches validator to end of chain.

@param ValidatorInterface $validator
@param boolean            $showMessages     Show messages for this
validator on failure.
@param string|null        $leadingTemplate  Validator's leading message
template.
@param string|null        $trailingTemplate Validator's trailing message
template.
@param int                $priority         Validator's priority.
@throws Exception\InvalidArgumentException
@return self
Attaches validator to end of chain .