public function isValid($value, $context = array())
    {
        $this->_setValue((string) $value);

        $fieldSet = (boolean) isset($context[$this->_fieldName]) && $context[$this->_fieldName];
        $valueSet = (boolean) $value;

        if ($valueSet && (! $fieldSet))  {
            return true;
        }

        if ((! $valueSet) && $fieldSet)  {
            return true;
        }

        $this->_error(self::NEITHER);
        return false;
    }
public function isValid($value, $context = array())
    {
        $this->_setValue((string) $value);

        $fieldSet = (boolean) isset($context[$this->_fieldName]) && $context[$this->_fieldName];
        $valueSet = (boolean) $value;

        if ($valueSet && (! $fieldSet))  {
            return true;
        }

        if ((! $valueSet) && $fieldSet)  {
            return true;
        }

        $this->_error(self::NEITHER);
        return false;
    }
public function isValid ( $ value , $ context = array ( ) ) { $ this -> _setValue ( ( string ) $ value ) ; $ fieldSet = ( boolean ) isset ( $ context [ $ this -> _fieldName ] ) && $ context [ $ this -> _fieldName ] ; $ valueSet = ( boolean ) $ value ; if ( $ valueSet && ( ! $ fieldSet ) ) { return true ; } if ( ( ! $ valueSet ) && $ fieldSet ) { return true ; } $ this -> _error ( self :: NEITHER ) ; return false ; }
Defined by \Zend_Validate_Interface

Returns true if and only if a token has been set and the provided value
matches that token.

@param  mixed $value
@return boolean
Defined by \ Zend_Validate_Interface