xpdo/transport/xpdoobjectvehicle.class.php
- package
- xpdo
- subpackage
- transport
- Classes
- xPDOObjectVehicle
Description
Defines a class that represents an xPDOObject within a transportable package.
\xPDOObjectVehicle
- Extends from
- \xPDOVehicle
- package
- xpdo
- subpackage
- transport
- Properties
- $class
- Methods
- _installObject
- _installRelated
- _putRelated
- _uninstallObject
- _uninstallRelated
- get
- install
- put
- uninstall
Description
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.).
Properties
$class
$class = 'xPDOObjectVehicle'
Details
- visibility
- public
- default
- xPDOObjectVehicle
- final
- false
- static
- false
Methods
_installObject
_installObject(
\xPDOTransport $transport, array $options, array $element, \xPDOObject $parentObject, array $fkMeta
)
:
Install a single xPDOObject from the vehicle payload.
Arguments
- $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.
Details
- visibility
- protected
- final
- false
- static
- false
_installRelated
_installRelated(
$transport, $parent, $element, $options
)
:
Installs a related object from the vehicle.
Arguments
- $transport
- $parent
- $element
- $options
Details
- visibility
- public
- final
- false
- static
- false
_putRelated
_putRelated(
\xPDOTransport $transport, string $alias, \xPDOObject $object, array $payloadElement
)
:
Recursively put related objects into the vehicle.
Arguments
- $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.
Details
- visibility
- protected
- final
- false
- static
- false
- access
- protected
_uninstallObject
_uninstallObject(
$transport, $options, $element, $parentObject, $fkMeta
)
:
Uninstall the xPDOObjects represented by a vehicle element from the transport host.
Arguments
- $transport
- $options
- $element
- $parentObject
- $fkMeta
Details
- visibility
- public
- final
- false
- static
- false
_uninstallRelated
_uninstallRelated(
$transport, $parent, $element, $options
)
:
Uninstalls related objects from the vehicle.
Arguments
- $transport
- $parent
- $element
- $options
Details
- visibility
- public
- final
- false
- static
- false
get
get(
\xPDOTransport $transport, array $options
=
array, array $element
=
null
)
:
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.
Arguments
- $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.
Details
- visibility
- public
- final
- false
- static
- false
install
install(
\xPDOTransport $transport, array $options
)
:
boolean
Install the xPDOObjects represented by vehicle into the transport host.
Arguments
- $transport
- \xPDOTransport
&$transport A reference to the transport. - $options
- array
An array of options for altering the installation of the artifact.
Output
- boolean
- True if the installation of the vehicle artifact was successful.
Details
- visibility
- public
- final
- false
- static
- false
put
put(
\xPDOTransport $transport, mixed $object, array $attributes
=
array
)
:
Put 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.
Arguments
- $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.
Details
- visibility
- public
- final
- false
- static
- false
uninstall
uninstall(
\xPDOTransport $transport, array $options
)
:
Uninstalls vehicle artifacts from the transport host.
Arguments
- $transport
- \xPDOTransport
&$transport A reference to the transport. - $options
- array
An array of options for altering the uninstallation of the artifact.
Details
- visibility
- public
- final
- false
- static
- false