Class Module
A module of the framework.
-
ICanBoogie\Prototyped
-
┗
ICanBoogie\Module
Methods summary
protected
get_id( void )
: string
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
get_path( void )
: string
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
get_descriptor( void )
: array
Returns the descriptor of the module.
public
__toString( void )
: string
Returns the identifier of the module.
Returns the identifier of the module.
Returns
string
protected
get_flat_id( void )
: string
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
get_model( void )
: ActiveRecord\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
get_title( void )
: string
Returns the module title, translated to the current language.
Returns the module title, translated to the current language.
Deprecated
Returns
string
protected
get_parent( void )
: ICanBoogie\Module
|null
Returns the parent module.
Returns the parent module.
Returns
public
is_installed( ICanBoogie\ErrorCollection $errors
)
: mixed
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
install( ICanBoogie\ErrorCollection $errors
)
: boolean|null
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
uninstall( void )
: boolean|null
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
model( string $which
= 'primary' )
: ICanBoogie\ActiveRecord\Model
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.
public
getBlock( string $name
)
: mixed
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
PERMISSION_NONE
: integer
0
PERMISSION_ACCESS
: integer
1
PERMISSION_CREATE
: integer
2
PERMISSION_MAINTAIN
: integer
3
PERMISSION_MANAGE
: integer
4
PERMISSION_ADMINISTER
: integer
5
OPERATION_SAVE
: string
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'
OPERATION_DELETE
: string
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
$descriptor
: array
The descriptor of the module.
The descriptor of the module.
Magic properties
public read-only
$descriptor
: array
The descriptor of the module.
public read-only
$flat_id
: string
public read-only
$id
: string
The identifier of the module, defined by ICanBoogie\Descriptor::ID.
public read-only
$model
: ICanBoogie\ActiveRecord\Model
The primary model of the module.
public read-only
$parent
: ICanBoogie\Module
The parent module, defined by ICanBoogie\Descriptor::INHERITS.
public read-only
$path
: string
The path to the module, defined by ICanBoogie\Descriptor::PATH.
public read-only
$title
: string
The localized title of the module.