src/xPDO/Transport/xPDOObjectVehicle.php
public function get(& $transport, $options = array (), $element = null) {
        $object = null;
        $element = parent :: get($transport, $options, $element);
        if (isset ($element['class']) && isset ($element['object'])) {
            $vClass = $element['class'];
            if (!empty ($element['package'])) {
                $pkgPrefix = $element['package'];
                $pkgKeys = array_keys($transport->xpdo->packages);
                if ($pkgFound = in_array($pkgPrefix, $pkgKeys)) {
                    $pkgPrefix = '';
                }
                elseif ($pos = strpos($pkgPrefix, '.')) {
                    $prefixParts = explode('.', $pkgPrefix);
                    $prefix = '';
                    foreach ($prefixParts as $prefixPart) {
                        $prefix .= $prefixPart;
                        $pkgPrefix = substr($pkgPrefix, $pos +1);
                        if ($pkgFound = in_array($prefix, $pkgKeys))
                            break;
                        $prefix .= '.';
                        $pos = strpos($pkgPrefix, '.');
                    }
                    if (!$pkgFound)
                        $pkgPrefix = $element['package'];
                }
                $vClass = (!empty ($pkgPrefix) ? $pkgPrefix . '.' : '') . $vClass;
            }
            $object = $transport->xpdo->newObject($vClass);
            if (is_object($object) && $object instanceof xPDOObject) {
                $options = array_merge($options, $element);
                $setKeys = false;
                if (isset ($options[xPDOTransport::PRESERVE_KEYS])) {
                    $setKeys = (boolean) $options[xPDOTransport::PRESERVE_KEYS];
                }
                $object->fromJSON($element['object'], '', $setKeys, true);
            }
        }
        return $object;
    }
public function get(& $transport, $options = array (), $element = null) {
        $object = null;
        $element = parent :: get($transport, $options, $element);
        if (isset ($element['class']) && isset ($element['object'])) {
            $vClass = $element['class'];
            if (!empty ($element['package'])) {
                $pkgPrefix = $element['package'];
                $pkgKeys = array_keys($transport->xpdo->packages);
                if ($pkgFound = in_array($pkgPrefix, $pkgKeys)) {
                    $pkgPrefix = '';
                }
                elseif ($pos = strpos($pkgPrefix, '.')) {
                    $prefixParts = explode('.', $pkgPrefix);
                    $prefix = '';
                    foreach ($prefixParts as $prefixPart) {
                        $prefix .= $prefixPart;
                        $pkgPrefix = substr($pkgPrefix, $pos +1);
                        if ($pkgFound = in_array($prefix, $pkgKeys))
                            break;
                        $prefix .= '.';
                        $pos = strpos($pkgPrefix, '.');
                    }
                    if (!$pkgFound)
                        $pkgPrefix = $element['package'];
                }
                $vClass = (!empty ($pkgPrefix) ? $pkgPrefix . '.' : '') . $vClass;
            }
            $object = $transport->xpdo->newObject($vClass);
            if (is_object($object) && $object instanceof xPDOObject) {
                $options = array_merge($options, $element);
                $setKeys = false;
                if (isset ($options[xPDOTransport::PRESERVE_KEYS])) {
                    $setKeys = (boolean) $options[xPDOTransport::PRESERVE_KEYS];
                }
                $object->fromJSON($element['object'], '', $setKeys, true);
            }
        }
        return $object;
    }
public function get ( & $ transport , $ options = array ( ) , $ element = null ) { $ object = null ; $ element = parent :: get ( $ transport , $ options , $ element ) ; if ( isset ( $ element [ 'class' ] ) && isset ( $ element [ 'object' ] ) ) { $ vClass = $ element [ 'class' ] ; if ( ! empty ( $ element [ 'package' ] ) ) { $ pkgPrefix = $ element [ 'package' ] ; $ pkgKeys = array_keys ( $ transport -> xpdo -> packages ) ; if ( $ pkgFound = in_array ( $ pkgPrefix , $ pkgKeys ) ) { $ pkgPrefix = '' ; } elseif ( $ pos = strpos ( $ pkgPrefix , '.' ) ) { $ prefixParts = explode ( '.' , $ pkgPrefix ) ; $ prefix = '' ; foreach ( $ prefixParts as $ prefixPart ) { $ prefix .= $ prefixPart ; $ pkgPrefix = substr ( $ pkgPrefix , $ pos + 1 ) ; if ( $ pkgFound = in_array ( $ prefix , $ pkgKeys ) ) break ; $ prefix .= '.' ; $ pos = strpos ( $ pkgPrefix , '.' ) ; } if ( ! $ pkgFound ) $ pkgPrefix = $ element [ 'package' ] ; } $ vClass = ( ! empty ( $ pkgPrefix ) ? $ pkgPrefix . '.' : '' ) . $ vClass ; } $ object = $ transport -> xpdo -> newObject ( $ vClass ) ; if ( is_object ( $ object ) && $ object instanceof xPDOObject ) { $ options = array_merge ( $ options , $ element ) ; $ setKeys = false ; if ( isset ( $ options [ xPDOTransport :: PRESERVE_KEYS ] ) ) { $ setKeys = ( boolean ) $ options [ xPDOTransport :: PRESERVE_KEYS ] ; } $ object -> fromJSON ( $ element [ 'object' ] , '' , $ setKeys , true ) ; } } return $ object ; }
Retrieve an xPDOObject instance represented in this vehicle.

This method returns the main object contained in the payload, but you can optionally specify
a related_objects node within the payload to retrieve a specific dependent object.
Retrieve an xPDOObject instance represented in this vehicle .