public function setError($name, $error)
    {
        if (!$this->getInputFilter() instanceof ErrorMessageInterface) {
            throw new NotSupportedException(sprintf(
                'Method %s::%s() is not supported.',
                get_class($this->getInputFilter()),
                __FUNCTION__
            ));
        }
        $this->getInputFilter()->setMessage($name, $error);
        return $this;
    }
public function setError($name, $error)
    {
        if (!$this->getInputFilter() instanceof ErrorMessageInterface) {
            throw new NotSupportedException(sprintf(
                'Method %s::%s() is not supported.',
                get_class($this->getInputFilter()),
                __FUNCTION__
            ));
        }
        $this->getInputFilter()->setMessage($name, $error);
        return $this;
    }
public function setError ( $ name , $ error ) { if ( ! $ this -> getInputFilter ( ) instanceof ErrorMessageInterface ) { throw new NotSupportedException ( sprintf ( 'Method %s::%s() is not supported.' , get_class ( $ this -> getInputFilter ( ) ) , __FUNCTION__ ) ) ; } $ this -> getInputFilter ( ) -> setMessage ( $ name , $ error ) ; return $ this ; }
Set error message for the input.
@param string $name
@param string $error
@return static
@since 1.2.2
@throws NotSupportedException
Set error message for the input .