public function isValid()
    {
        if ($this->valid === null) {
            $this->valid = true;

            if (sizeof($this->validators) > 0) {
                foreach ($this->validators as $validator) {
                    if (!$validator->isValid()) {
                        $this->errors[] = $validator->getErrorMessage();
                        $this->valid = false;
                    }
                }
            }
        }

        return $this->valid;
    }
public function isValid()
    {
        if ($this->valid === null) {
            $this->valid = true;

            if (sizeof($this->validators) > 0) {
                foreach ($this->validators as $validator) {
                    if (!$validator->isValid()) {
                        $this->errors[] = $validator->getErrorMessage();
                        $this->valid = false;
                    }
                }
            }
        }

        return $this->valid;
    }
public function isValid ( ) { if ( $ this -> valid === null ) { $ this -> valid = true ; if ( sizeof ( $ this -> validators ) > 0 ) { foreach ( $ this -> validators as $ validator ) { if ( ! $ validator -> isValid ( ) ) { $ this -> errors [ ] = $ validator -> getErrorMessage ( ) ; $ this -> valid = false ; } } } } return $ this -> valid ; }
Check if this field is valid or not.
It will cache it's result.
If a new validator is added, it's cached value is reset.

@return boolean
Check if this field is valid or not . It will cache it s result . If a new validator is added it s cached value is reset .