core/xpdo/transport/xpdoobjectvehicle.class.php
Defines a class that represents an xPDOObject within a transportable package.
- Package
- xpdo
- Subpackage
- transport
\xPDOObjectVehicle
Represents an xPDOObject within an {@link xPDOTransport} package.
Extend this abstract class to provide custom xPDOVehicle behavior for various kinds of artifacts (e.g. objects, xPDOObjects, files, database schemas, etc.).
- Parent(s)
- \xPDOVehicle
Properties

array
$payload= 'array ()'
Represents the artifact and related attributes stored in the vehicle.
Inherited from: \xPDOVehicle::$$payloadarray ()Details- Type
- array
- Inherited_from
- \xPDOVehicle::$$payload
Methods

_compilePayload(
\xPDOTransport $transport
)
:
voidCompile necessary resources in preparation for storing the vehicle.
Inherited from: \xPDOVehicle::_compilePayload()| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | &$transport A reference to the transport the vehicle is being stored in. |
- Access
- protected

_installObject(
\xPDOTransport $transport, array $options, array $element, \xPDOObject $parentObject, array $fkMeta
)
:
voidInstall a single xPDOObject from the vehicle payload.
| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | The host xPDOTransport instance. |
| $options | array | Any optional attributes to apply to the installation. |
| $element | array | A node of the payload representing the object to install. |
| $parentObject | \xPDOObject | &$parentObject A reference to the object serving as a parent to the one being installed. |
| $fkMeta | array | The foreign key relationship data that defines the relationship with the parentObject. |

_installRelated(
$transport, $parent, $element, $options
)
:
voidInstalls a related object from the vehicle.
| Name | Type | Description |
|---|---|---|
| $transport | ||
| $parent | ||
| $element | ||
| $options |

_putRelated(
\xPDOTransport $transport, string $alias, \xPDOObject $object, array $payloadElement
)
:
voidRecursively put related objects into the vehicle.
| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | The host xPDOTransport instance. |
| $alias | string | The alias representing the relation to the parent object. |
| $object | \xPDOObject | &$object A reference to the dependent object being added into the vehicle. |
| $payloadElement | array | An element of the payload to place the dependent object in. |
- Access
- protected

_uninstallObject(
$transport, $options, $element, $parentObject, $fkMeta
)
:
voidUninstall the xPDOObjects represented by a vehicle element from the transport host.
| Name | Type | Description |
|---|---|---|
| $transport | ||
| $options | ||
| $element | ||
| $parentObject | ||
| $fkMeta |

_uninstallRelated(
$transport, $parent, $element, $options
)
:
voidUninstalls related objects from the vehicle.
| Name | Type | Description |
|---|---|---|
| $transport | ||
| $parent | ||
| $element | ||
| $options |

get(
\xPDOTransport $transport, array $options
=
array (), array $element
=
null
)
:
voidRetrieve 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.
| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | The transport package containing this vehicle. |
| $options | array | Options that apply to the artifact or retrieval process. |
| $element | array | An optional payload element representing a specific part of the artifact to operate on. If not specified, the root element of the payload is used. |

install(
\xPDOTransport $transport, array $options
)
:
booleanInstall the xPDOObjects represented by vehicle into the transport host.
| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | &$transport A reference to the transport. |
| $options | array | An array of options for altering the installation of the artifact. |
| Type | Description |
|---|---|
| boolean | True if the installation of the vehicle artifact was successful. |

put(
\xPDOTransport $transport, mixed $object, array $attributes
=
array ()
)
:
voidPut an xPDOObject representation into a transport package.
This implementation supports the inclusion of related objects. Simply instantiate the related objects that you want to include in the vehicle on the main object, and set xPDOTransport::RELATED_OBJECTS => true in your attributes.
| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | The transport package hosting the vehicle. |
| $object | mixed | &$object A reference to the artifact this vehicle will represent. |
| $attributes | array | Additional attributes represented in the vehicle. |

register(
\xPDOTransport $transport
)
:
arrayBuild a manifest entry to be registered in a transport for this vehicle.
Inherited from: \xPDOVehicle::register()| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | &$transport The xPDOTransport instance to register the vehicle into. |
| Type | Description |
|---|---|
| array | An array of vehicle attributes that will be registered into an xPDOTransport manifest. |

resolve(
\xPDOTransport $transport, mixed $object, array $options
=
array ()
)
:
booleanResolve any dependencies of the artifact represented in this vehicle.
Inherited from: \xPDOVehicle::resolve()| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | &$transport A reference to the xPDOTransport in which this vehicle is stored. |
| $object | mixed | &$object An object reference to resolve dependencies for. Use this to make the artifact or other important data available to the resolver scripts. |
| $options | array | Additional options for the resolution process. |
| Type | Description |
|---|---|
| boolean | Indicates if the resolution was successful. |

store(
\xPDOTransport $transport
)
:
booleanStore this xPDOVehicle instance into an xPDOTransport.
Inherited from: \xPDOVehicle::store()| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | &$transport The transport to store the vehicle in. |
| Type | Description |
|---|---|
| boolean | Indicates if the vehicle was stored in the transport. |

uninstall(
\xPDOTransport $transport, array $options
)
:
voidUninstalls vehicle artifacts from the transport host.
| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | &$transport A reference to the transport. |
| $options | array | An array of options for altering the uninstallation of the artifact. |

validate(
\xPDOTransport $transport, \xPDOObject $object, array $options
=
array ()
)
:
booleanValidate any dependencies for the object represented in this vehicle.
Inherited from: \xPDOVehicle::validate()| Name | Type | Description |
|---|---|---|
| $transport | \xPDOTransport | &$transport A reference to the xPDOTransport in which this vehicle is stored. |
| $object | \xPDOObject | &$object An object reference to access during validation. |
| $options | array | Additional options for the validation process. |
| Type | Description |
|---|---|
| boolean | Indicating if the validation was successful. |