Class ModuleCollection
A module collection.
- ICanBoogie\Module\ModuleCollection implements ArrayAccess, IteratorAggregate uses ICanBoogie\Accessor\AccessorTrait (not available)
Methods summary
public static
format_model_name( string $module_id
, string $model_id
= 'primary' )
: string
Formats a SQL table name given the module id and the model id.
public
__construct( array $paths
, ICanBoogie\Storage\Storage $cache
= null )
The index for the available modules is created with the accessor object.
public
offsetSet( mixed $id
, mixed $enable
)
Used to enable or disable a module using the specified offset as the module's id.
public
offsetUnset( string $id
)
Disables a module by setting the Descriptor::DISABLED key of its descriptor to true
.
protected
lazy_get_index( void )
: array
Indexes the modules found in the paths specified during construct.
protected
lazy_get_disabled_modules_descriptors( void )
: array
Returns the descriptors of the disabled modules.
protected
lazy_get_enabled_modules_descriptors( void )
: array
Returns the descriptors of the enabled modules.
protected
lazy_get_locale_paths( void )
: array[]string
Returns the paths of the enabled modules which have a locale
folder.
protected
lazy_get_config_paths( void )
: array[]string
Returns the paths of the enabled modules which have a config
folder.
public
order_ids( array $ids
, array $descriptors
= null )
: array
Orders the module ids provided according to module inheritance and weight.
public
filter_descriptors_by_users( string $module_id
, boolean $all
= self::ONLY_ENABLED_MODULES )
: array
Returns the modules using a module.
public
usage( string $module_id
, boolean $all
= self::ONLY_ENABLED_MODULES )
: integer
Returns the usage of a module by other modules.
public
is_inheriting( string $module_id
, string $parent_id
)
: boolean
Checks if a module inherits from another.
public
install( ICanBoogie\Errors $errors
= null )
: ICanBoogie\Errors
Install all the enabled modules.
public
resolve_classname( string $unqualified_classname
, string|ICanBoogie\Module
$module
)
: string|false
Resolves a class name using module inheritance.
Constants summary
ONLY_ENABLED_MODULES
: boolean
May be used with the ICanBoogie\Module\ModuleCollection::filter_descriptors_by_users()
method to filter the descriptors
of enabled modules.
false
ALL_MODULES
: boolean
May be used with the ICanBoogie\Module\ModuleCollection::filter_descriptors_by_users()
method to filter the descriptors
of all modules, enabled or not.
true