ICanBoogie/Module 4.0.x
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Module
      • ModuleCollection
      • Operation

Classes

  • Module

Class Module

A module of the framework.

ICanBoogie\Prototyped
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.

Deprecated

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\ErrorCollection $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\ErrorCollection $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 array
# resolve_model_tags( array|string $tags, string $which )

Resolves model tags.

Resolves model tags.

Parameters

$tags
$which

Returns

array
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

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 Application $app
ICanBoogie/Module 4.0.x API documentation generated by ApiGen