src/xPDO/Transport/xPDOVehicle.php
public function validate(& $transport, & $object, $options = array ()) {
        $validated = true;
        if (isset ($this->payload['validate'])) {
            foreach ($this->payload['validate'] as $rKey => $r) {
                $type = $r['type'];
                $body = $r['body'];
                switch ($type) {
                    case 'php' :
//                        if (isset ($options[xPDOTransport::VALIDATE_PHP]) && !$options[xPDOTransport::VALIDATE_PHP]) {
//                            continue;
//                        }
                        $fileMeta = $transport->xpdo->fromJSON($body, true);
                        $fileName = $fileMeta['name'];
                        $fileSource = $transport->path . $fileMeta['source'];
                        if (!$validated = include ($fileSource)) {
                            if (!isset($fileMeta['silent_fail']) || !$fileMeta['silent_fail']) {
                                $transport->xpdo->log(xPDO::LOG_LEVEL_ERROR, "xPDOVehicle validator failed: type php ({$fileSource})");
                            }
                        }
                        break;

                    default :
                        $transport->xpdo->log(xPDO::LOG_LEVEL_WARN, "xPDOVehicle does not support validators of type {$type}.");
                        break;
                }
            }
        } else {
            $validated = true;
        }
        return $validated;
    }
public function validate(& $transport, & $object, $options = array ()) {
        $validated = true;
        if (isset ($this->payload['validate'])) {
            foreach ($this->payload['validate'] as $rKey => $r) {
                $type = $r['type'];
                $body = $r['body'];
                switch ($type) {
                    case 'php' :
//                        if (isset ($options[xPDOTransport::VALIDATE_PHP]) && !$options[xPDOTransport::VALIDATE_PHP]) {
//                            continue;
//                        }
                        $fileMeta = $transport->xpdo->fromJSON($body, true);
                        $fileName = $fileMeta['name'];
                        $fileSource = $transport->path . $fileMeta['source'];
                        if (!$validated = include ($fileSource)) {
                            if (!isset($fileMeta['silent_fail']) || !$fileMeta['silent_fail']) {
                                $transport->xpdo->log(xPDO::LOG_LEVEL_ERROR, "xPDOVehicle validator failed: type php ({$fileSource})");
                            }
                        }
                        break;

                    default :
                        $transport->xpdo->log(xPDO::LOG_LEVEL_WARN, "xPDOVehicle does not support validators of type {$type}.");
                        break;
                }
            }
        } else {
            $validated = true;
        }
        return $validated;
    }
public function validate ( & $ transport , & $ object , $ options = array ( ) ) { $ validated = true ; if ( isset ( $ this -> payload [ 'validate' ] ) ) { foreach ( $ this -> payload [ 'validate' ] as $ rKey => $ r ) { $ type = $ r [ 'type' ] ; $ body = $ r [ 'body' ] ; switch ( $ type ) { case 'php' : //                        if (isset ($options[xPDOTransport::VALIDATE_PHP]) && !$options[xPDOTransport::VALIDATE_PHP]) { //                            continue; //                        } $ fileMeta = $ transport -> xpdo -> fromJSON ( $ body , true ) ; $ fileName = $ fileMeta [ 'name' ] ; $ fileSource = $ transport -> path . $ fileMeta [ 'source' ] ; if ( ! $ validated = include ( $ fileSource ) ) { if ( ! isset ( $ fileMeta [ 'silent_fail' ] ) || ! $ fileMeta [ 'silent_fail' ] ) { $ transport -> xpdo -> log ( xPDO :: LOG_LEVEL_ERROR , "xPDOVehicle validator failed: type php ({$fileSource})" ) ; } } break ; default : $ transport -> xpdo -> log ( xPDO :: LOG_LEVEL_WARN , "xPDOVehicle does not support validators of type {$type}." ) ; break ; } } } else { $ validated = true ; } return $ validated ; }
Validate any dependencies for the object represented in this vehicle.

@param xPDOTransport &$transport A reference to the xPDOTransport in
which this vehicle is stored.
@param xPDOObject &$object An object reference to access during
validation.
@param array $options Additional options for the validation process.
@return boolean Indicating if the validation was successful.
Validate any dependencies for the object represented in this vehicle .