src/PAGI/Node/Node.php
public function validate()
    {
        foreach ($this->inputValidations as $name => $data) {
            $validator = $data['callback'];
            $result = $validator($this);
            if ($result === false) {
                $this->logDebug("Validation FAILED: $name");
                $onError = $data['soundOnError'];
                if (is_array($onError)) {
                    foreach ($onError as $msg) {
                        $this->addPrePromptMessage($msg);
                    }
                } elseif (is_string($onError)) {
                    $this->addPrePromptMessage($onError);
                } else {
                    $this->logDebug("Ignoring validation sound: " . print_r($onError, true));
                }
                return false;
            }
            $this->logDebug("Validation OK: $name");
        }
        return true;
    }
public function validate()
    {
        foreach ($this->inputValidations as $name => $data) {
            $validator = $data['callback'];
            $result = $validator($this);
            if ($result === false) {
                $this->logDebug("Validation FAILED: $name");
                $onError = $data['soundOnError'];
                if (is_array($onError)) {
                    foreach ($onError as $msg) {
                        $this->addPrePromptMessage($msg);
                    }
                } elseif (is_string($onError)) {
                    $this->addPrePromptMessage($onError);
                } else {
                    $this->logDebug("Ignoring validation sound: " . print_r($onError, true));
                }
                return false;
            }
            $this->logDebug("Validation OK: $name");
        }
        return true;
    }
public function validate ( ) { foreach ( $ this -> inputValidations as $ name => $ data ) { $ validator = $ data [ 'callback' ] ; $ result = $ validator ( $ this ) ; if ( $ result === false ) { $ this -> logDebug ( "Validation FAILED: $name" ) ; $ onError = $ data [ 'soundOnError' ] ; if ( is_array ( $ onError ) ) { foreach ( $ onError as $ msg ) { $ this -> addPrePromptMessage ( $ msg ) ; } } elseif ( is_string ( $ onError ) ) { $ this -> addPrePromptMessage ( $ onError ) ; } else { $ this -> logDebug ( "Ignoring validation sound: " . print_r ( $ onError , true ) ) ; } return false ; } $ this -> logDebug ( "Validation OK: $name" ) ; } return true ; }
Calls all validators in order. Will stop when any of them returns false.

@return boolean
Calls all validators in order . Will stop when any of them returns false .