ICanBoogie/Module 2.3.x
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Module

Classes

  • DeleteOperation
  • Module
  • SaveOperation

Class Module

A module of the framework.

ICanBoogie\Object
Extended by ICanBoogie\Module
Namespace: ICanBoogie
Located at Module.php

Methods summary

protected string
# get_id( )

Returns the identifier of the module as defined by its descriptor.

Returns the identifier of the module as defined by its descriptor.

This method is the getter for the $id magic property.

Returns

string
protected string
# get_path( )

Returns the path of the module as defined by its descriptor.

Returns the path of the module as defined by its descriptor.

This method is the getter for the $path magic property.

Returns

string
protected array
# get_descriptor( )

Returns the descriptor of the module.

Returns the descriptor of the module.

This method is the getter for the ICanBoogie\Module::$descriptor magic property.

Returns

array
protected ICanBoogie\Module\ModuleCollection
# get_collection( )

Returns

ICanBoogie\Module\ModuleCollection
public
# __construct( ICanBoogie\Module\ModuleCollection $collection, array $descriptor )

Constructor.

Constructor.

Initializes the ICanBoogie\Module::$descriptor property.

Parameters

$collection
$descriptor
public string
# __toString( )

Returns the identifier of the module.

Returns the identifier of the module.

Returns

string
protected string
# get_flat_id( )

Returns the flat version of the module's identifier.

Returns the flat version of the module's identifier.

This method is the getter for the $flat_id magic property.

Returns

string
protected ActiveRecord\Model
# get_model( )

Returns the primary model of the module.

Returns the primary model of the module.

This is the getter for the ICanBoogie\Module::model() magic property.

Returns

ActiveRecord\Model
protected string
# get_title( )

Returns the module title, translated to the current language.

Returns the module title, translated to the current language.

Returns

string
protected ICanBoogie\Module|null
# get_parent( )

Returns the parent module.

Returns the parent module.

Returns

ICanBoogie\Module|null
public mixed
# is_installed( ICanBoogie\Errors $errors )

Checks if the module is installed.

Checks if the module is installed.

Parameters

$errors
Error collection.

Returns

mixed

true if the module is installed, false if the module (or parts of) is not installed, null if the module has no installation.

public boolean|null
# install( ICanBoogie\Errors $errors )

Install the module.

Install the module.

If the module has models they are installed.

Parameters

$errors
Error collection.

Returns

boolean|null

true if the module has successfully been installed, false if the module (or parts of the module) fails to install or null if the module has no installation process.

public boolean|null
# uninstall( )

Uninstall the module.

Uninstall the module.

Basically it uninstall the models installed by the module.

Returns

boolean|null

true if the module was successfully uninstalled. false if the module (or parts of the module) failed to uninstall. null if there is no uninstall process.

public ICanBoogie\ActiveRecord\Model
# model( string $which = 'primary' )

Get a model from the module.

Get a model from the module.

If the model has not been created yet, it is created on the fly.

Parameters

$which
The identifier of the model to get.

Returns

ICanBoogie\ActiveRecord\Model
The requested model.

Throws

ICanBoogie\ActiveRecord\ModelNotDefined
when the model is not defined by the module.
RuntimeException
when the class of the model does not exists.
protected
# resolve_model_tags( $tags, $which )
public mixed
# getBlock( string $name )

Get a block.

Get a block.

Parameters

$name
The name of the block to get.

Returns

mixed

Depends on the implementation. Should return a string or an object implementing __toString.

Throws

RuntimeException
if the block is not defined.

Constants summary

string T_CATEGORY

Defines the category for the module.

Defines the category for the module.

When modules are listed they are usually grouped by category. The category is also often used to create the main navigation menu of the admin interface.

The category of the module is translated within the module_category scope.

Deprecated

# 'category'
string T_CLASS

Defines the PHP class of the module.

Defines the PHP class of the module.

If the class is not defined it is resolved during indexing using the ICanBoogie\Module::T_NAMESPACE tag and the following pattern : <namespace>\Module.

Deprecated

# 'class'
string T_DESCRIPTION

Defines a short description of what the module do.

Defines a short description of what the module do.

Deprecated

# 'description'
boolean T_DISABLED

Defines the state of the module.

Defines the state of the module.

Deprecated

# 'disabled'
string|ICanBoogie\Module T_EXTENDS

Defines the module that the module extends.

Defines the module that the module extends.

Deprecated

# 'extends'
string T_ID

Defines the identifier of the module.

Defines the identifier of the module.

If the identifier is not defined the name of the module directory is used instead.

Deprecated

# 'id'
boolean T_REQUIRED

Defines the state of the module.

Defines the state of the module.

Required modules are always enabled.

Deprecated

# 'required'
array[string]string T_REQUIRES

Defines the modules that the module requires.

Defines the modules that the module requires.

The required modules are defined using an array where each key/value pair is the identifier of the module and the minimum version required.

Deprecated

# 'requires'
array[string]array|string T_MODELS

Defines the models of the module.

Defines the models of the module.

Deprecated

# 'models'
string T_NAMESPACE

Defines the namespace of the module.

Defines the namespace of the module.

This attribute must be defined at construct time.

Deprecated

# 'namespace'
string T_PATH

Path to the module's directory.

Path to the module's directory.

This tag is resolved when the module is indexed.

Deprecated

# 'path'
string|integer T_PERMISSION

General permission of the module.

General permission of the module.

Deprecated

# 'permission'
array[]string T_PERMISSIONS

Defines the permissions added by the module.

Defines the permissions added by the module.

Deprecated

# 'permissions'
string T_TITLE

Defines the title of the module.

Defines the title of the module.

The title of the module is translated within the module_title scope.

Deprecated

# 'title'
string T_VERSION

Defines the version (and revision) of the module.

Defines the version (and revision) of the module.

Deprecated

# 'version'
integer T_WEIGHT

Defines the weight of the module.

Defines the weight of the module.

The weight of the module is resolved during modules indexing according to the ICanBoogie\Module::T_EXTENDS and ICanBoogie\Module::T_REQUIRES tags.

Deprecated

# 'weight'
integer PERMISSION_NONE
# 0
integer PERMISSION_ACCESS
# 1
integer PERMISSION_CREATE
# 2
integer PERMISSION_MAINTAIN
# 3
integer PERMISSION_MANAGE
# 4
integer PERMISSION_ADMINISTER
# 5
string OPERATION_SAVE

Defines the name of the operation used to save the records of the module.

Defines the name of the operation used to save the records of the module.

# 'save'
string OPERATION_DELETE

Defines the name of the operation used to delete the records of the module.

Defines the name of the operation used to delete the records of the module.

# 'delete'

Properties summary

protected array $descriptor

The descriptor of the module.

The descriptor of the module.

#

Magic properties

public read-only array $descriptor

The descriptor of the module.

public read-only string $flat_id

Underscored identifier.

public read-only string $id

The identifier of the module, defined by ICanBoogie\Descriptor::ID.

public read-only ICanBoogie\ActiveRecord\Model $model

The primary model of the module.

public read-only ICanBoogie\Module $parent

The parent module, defined by ICanBoogie\Descriptor::INHERITS.

public read-only string $path

The path to the module, defined by ICanBoogie\Descriptor::PATH.

public read-only string $title

The localized title of the module.

public read-only ICanBoogie\Module\ModuleCollection $collection
public read-only Core $app
ICanBoogie/Module 2.3.x API documentation generated by ApiGen