PHP Class Puli\Manager\Api\Module\ModuleList

Since: 1.0
Author: Bernhard Schussek ([email protected])
Inheritance: implements IteratorAggregat\IteratorAggregate, implements Countabl\Countable, implements ArrayAcces\ArrayAccess
Afficher le fichier Open project: puli/manager Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $modules = [] )
add ( Puli\Manager\Api\Module\Module $module ) Adds a module to the collection.
clear ( ) Removes all modules from the collection.
contains ( string $name ) : boolean Returns whether a module with the given name exists.
count ( )
get ( string $name ) : Puli\Manager\Api\Module\Module Returns the module with the given name.
getInstalledModuleNames ( ) : string[] Returns the names of all installed modules.
getInstalledModules ( ) : Puli\Manager\Api\Module\Module[] Returns all installed modules.
getIterator ( )
getModuleNames ( ) : string[] Returns the names of all modules.
getRootModule ( ) : Puli\Manager\Api\Module\RootModule | null Returns the root module.
getRootModuleName ( ) : string | null Returns the name of the root module.
isEmpty ( ) : boolean Returns whether the collection is empty.
merge ( array $modules ) Adds multiple modules to the collection.
offsetExists ( $name )
offsetGet ( $name )
offsetSet ( $name, $module )
offsetUnset ( $name )
remove ( string $name ) Removes a module from the collection.
replace ( array $modules ) Replaces the collection with the given modules.
toArray ( ) : Puli\Manager\Api\Module\Module[] Returns the modules in the collection.

Method Details

__construct() public méthode

public __construct ( array $modules = [] )
$modules array

add() public méthode

Adds a module to the collection.
public add ( Puli\Manager\Api\Module\Module $module )
$module Puli\Manager\Api\Module\Module The added module.

clear() public méthode

Removes all modules from the collection.
public clear ( )

contains() public méthode

Returns whether a module with the given name exists.
public contains ( string $name ) : boolean
$name string The module name.
Résultat boolean Whether a module with this name exists.

count() public méthode

public count ( )

get() public méthode

Returns the module with the given name.
public get ( string $name ) : Puli\Manager\Api\Module\Module
$name string The module name.
Résultat Puli\Manager\Api\Module\Module The module with the passed name.

getInstalledModuleNames() public méthode

The installed modules are all modules that are not the root module.
public getInstalledModuleNames ( ) : string[]
Résultat string[] The names of the installed modules.

getInstalledModules() public méthode

The installed modules are all modules that are not the root module.
public getInstalledModules ( ) : Puli\Manager\Api\Module\Module[]
Résultat Puli\Manager\Api\Module\Module[] The installed modules indexed by their names.

getIterator() public méthode

public getIterator ( )

getModuleNames() public méthode

Returns the names of all modules.
public getModuleNames ( ) : string[]
Résultat string[] The module names.

getRootModule() public méthode

If the collection contains no root module, null is returned.
public getRootModule ( ) : Puli\Manager\Api\Module\RootModule | null
Résultat Puli\Manager\Api\Module\RootModule | null The root module or `null` if none exists.

getRootModuleName() public méthode

If the collection contains no root module, null is returned.
public getRootModuleName ( ) : string | null
Résultat string | null The root module name or `null` if none exists.

isEmpty() public méthode

Returns whether the collection is empty.
public isEmpty ( ) : boolean
Résultat boolean Returns `true` if the collection is empty and `false` otherwise.

merge() public méthode

Adds multiple modules to the collection.
public merge ( array $modules )
$modules array The added modules.

offsetExists() public méthode

public offsetExists ( $name )

offsetGet() public méthode

public offsetGet ( $name )

offsetSet() public méthode

public offsetSet ( $name, $module )

offsetUnset() public méthode

public offsetUnset ( $name )

remove() public méthode

Removes a module from the collection.
public remove ( string $name )
$name string The module name.

replace() public méthode

Replaces the collection with the given modules.
public replace ( array $modules )
$modules array The modules to set.

toArray() public méthode

Returns the modules in the collection.
public toArray ( ) : Puli\Manager\Api\Module\Module[]
Résultat Puli\Manager\Api\Module\Module[] The modules in the collection.