core/model/modx/transport/modpackagebuilder.class.php
Abstracts the package building process
- Package
- modx
- Subpackage
- transport
\modPackageBuilder
Abstracts the package building process
- Children
- \modXMLPackageBuilder
Properties

array
$autoselects= ''
- Type
- array
- Access
- public

string
$directory= ''
- Type
- string
- Access
- public

string
$namespace= ''
- Type
- string
- Access
- public
Methods

__construct(
\modX $modx
)
:
\modPackageBuilderCreates an instance of the modPackageBuilder class.
| Name | Type | Description |
|---|---|---|
| $modx | \modX | &$modx A reference to a modX instance. |
| Type | Description |
|---|---|
| \modPackageBuilder |

buildSchema(
string $model, string $schema
)
:
booleanGenerates the model from a schema.
| Name | Type | Description |
|---|---|---|
| $model | string | The directory path of the model to generate to. |
| $schema | string | The schema file to generate from. |
| Type | Description |
|---|---|
| boolean | true if successful |
- Access
- public

create(
string $name, string $version, string $release
=
''
)
:
void| Name | Type | Description |
|---|---|---|
| $name | string | |
| $version | string | |
| $release | string |
- Deprecated
- To be removed in 2.2
- See
- \modPackageBuilder::createPackage

createPackage(
string $name, string $version, string $release
=
''
)
:
\xPDOTransportCreates a new xPDOTransport package.
| Name | Type | Description |
|---|---|---|
| $name | string | The name of the component the package represents. |
| $version | string | A string representing the version of the package. |
| $release | string | A string describing the specific release of this version of the package. |
| Type | Description |
|---|---|
| \xPDOTransport | The xPDOTransport package object. |
- Access
- public

createVehicle(
\xPDOObject $obj, array $attr
)
:
\modTransportVehicleCreates the modTransportVehicle for the specified object.
| Name | Type | Description |
|---|---|---|
| $obj | \xPDOObject | The xPDOObject being abstracted as a vehicle. |
| $attr | array | Attributes for the vehicle. |
| Type | Description |
|---|---|
| \modTransportVehicle | The createed modTransportVehicle instance. |
- Access
- public

getSignature(
)
:
stringRetrieves the package signature.
| Type | Description |
|---|---|
| string | The signature of the included package. |
- Access
- public

pack(
)
:
booleanPacks the package.
| Type | Description |
|---|---|
| boolean | True if successful. |
- Access
- public
- See
- \xPDOTransport::pack

putVehicle(
\modTransportVehicle $vehicle
)
:
booleanPuts the vehicle into the package.
| Name | Type | Description |
|---|---|---|
| $vehicle | \modTransportVehicle | The vehicle to insert into the package. |
| Type | Description |
|---|---|
| boolean | True if successful. |
- Access
- public

registerNamespace(
string | \modNamespace $ns
=
'core', boolean | array $autoincludes
=
true, boolean $packageNamespace
=
true, string $path
=
''
)
:
booleanRegisters a namespace to the transport package. If no namespace is found, will create a namespace.
| Name | Type | Description |
|---|---|---|
| $ns | string | \modNamespace | The modNamespace object or the string name of the namespace |
| $autoincludes | boolean | array | If true, will automatically select relative resources to the namespace. |
| $packageNamespace | boolean | If false, will not package the namespace as a vehicle. |
| $path | string | The path for the namespace to be created. |
| Type | Description |
|---|---|
| boolean | True if successful. |
- Access
- public

setAutoSelects(
array $classes
=
array ()
)
:
voidSets the classes that are to automatically be included and built into the package.
| Name | Type | Description |
|---|---|---|
| $classes | array | An array of class names to build in |
- Access
- public

setPackageAttributes(
array $attributes
=
array ()
)
:
nullSet an array of attributes into the xPDOTransport manifest.
| Name | Type | Description |
|---|---|---|
| $attributes | array | An array of attributes to set in the manifest of the package being built. |
| Type | Description |
|---|---|
| null |
- Access
- public

setWorkspace(
integer $workspace_id
)
:
\modWorkspaceAllows for customization of the package workspace.
| Name | Type | Description |
|---|---|---|
| $workspace_id | integer | The ID of the workspace to select. |
| Type | Description |
|---|---|
| \modWorkspace | The workspace set, false if invalid. |
- Access
- public