\apex\app\pkgpkg_component

Handles creating, adding, deleting, and updating components within packages. Used for all package / upgrade functions.

Summary

Methods
Properties
Constants
create()
add()
remove()
get_vars()
No public properties found
No constants found
create_view()
add_checks()
add_crontab()
No protected properties found
N/A
No private methods found
$code_templates
N/A

Properties

$code_templates

$code_templates :

Type

Methods

create()

create(string  $type,string  $comp_alias,string  $owner = '')

Create a new component. Used via the apex.php script, to create a new component including necessary files.

Parameters

string $type

The type of component (template, worker, lib, etc.)

string $comp_alias

Alias of the component in Apex format (ie. PACKAGE:[PARENT:]ALIAS

string $owner

Optional owner, only required for a few components (controller, tab_page, worker)

add()

add(string  $type,string  $comp_alias,string  $value = '',integer  $order_num,string  $owner = '')

Add component to database

Add a new component into the database. This will not actually create the necessary PHP / TPL files, and instead will only add the necessary row(s) into the database.

Parameters

string $type

The type of component (htmlfunc, worker, hash, etc.)

string $comp_alias

Alias of component in standard Apex format (PACKAGE:[PARENT:]ALIAS)

string $value

Only required for a few components such as 'config', and is the value of the component

integer $order_num

The order num of the component.

string $owner

Only needed for controller and tabpage components, and is the owner package of the component.

remove()

remove(string  $type,string  $comp_alias): boolean

Deletes a component from the database, including corresponding file(s).

Parameters

string $type

The type of component being deleted (eg. 'config', 'htmlfunc', etc.).

string $comp_alias

Alias of component to delete in standard Apex format (ie. PACKAGE:[PARENT:]ALIAS)

Returns

boolean —

Whether or not the operation was successful.

get_vars()

get_vars(string  $type,string  $alias,string  $package,string  $parent = '',string  $value = '',integer  $order_num): array

Get component vars

Used while compiling a package / upgrade, and only used to shorten the code, and ensure all component var arrays within the toc.json files are standardized.

Parameters

string $type

The component type.

string $alias

The component alias.

string $package

Alias of the package.

string $parent

Alias of the parent, if exists.

string $value

Optional value of the component.

integer $order_num

Optional order num of the component.

Returns

array —

The vars array to include in components.json file.

create_view()

create_view(string  $uri,string  $package)

Create a new template, including necessary files. Used by the apex.php script.

Parameters

string $uri

The URI of the view

string $package

The alias of the package owner

add_checks()

add_checks(string  $type,string  $comp_alias,string  $value = '',string  $owner = '')

Perform all necessary checks on a component before adding it to the database.

Parameters

string $type

The type of component (htmlfunc, worker, hash, etc.)

string $comp_alias

Alias of component in standard Apex format (PACKAGE:[PARENT:]ALIAS)

string $value

Only required for a few components such as 'config', and is the value of the component

string $owner

Only needed for controller and tabpage components, and is the owner package of the component.

add_crontab()

add_crontab(string  $package,string  $alias)

Adds a crontab job to the 'internal_crontab' table of the database

Parameters

string $package

The package the cron job is being added to.

string $alias

The alias of the crontab job.