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
ファイルを表示 Open project: puli/manager Class Usage Examples

Public Methods

Method 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 method

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

add() public method

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 method

Removes all modules from the collection.
public clear ( )

contains() public method

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

count() public method

public count ( )

get() public method

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

getInstalledModuleNames() public method

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

getInstalledModules() public method

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

getIterator() public method

public getIterator ( )

getModuleNames() public method

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

getRootModule() public method

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

getRootModuleName() public method

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

isEmpty() public method

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

merge() public method

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

offsetExists() public method

public offsetExists ( $name )

offsetGet() public method

public offsetGet ( $name )

offsetSet() public method

public offsetSet ( $name, $module )

offsetUnset() public method

public offsetUnset ( $name )

remove() public method

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

replace() public method

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

toArray() public method

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