ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ILIAS\GlobalScreen\Provider\ProviderFactory Class Reference

Class ProviderFactory. More...

+ Inheritance diagram for ILIAS\GlobalScreen\Provider\ProviderFactory:
+ Collaboration diagram for ILIAS\GlobalScreen\Provider\ProviderFactory:

Public Member Functions

 __construct (array $main_bar_providers, ItemInformation $main_menu_item_information)
 ProviderFactory constructor. More...
 
 getMainBarProvider ()
 @inheritDoc More...
 
 getMainBarItemInformation ()
 @inheritDoc More...
 
 getProviderByClassName (string $class_name)
 @inheritDoc More...
 
 isInstanceCreationPossible (string $class_name)
 @inheritDoc More...
 
 isRegistered (string $class_name)
 @inheritDoc More...
 
 getMainBarProvider ()
 
 getMainBarItemInformation ()
 
 getProviderByClassName (string $class_name)
 
 isInstanceCreationPossible (string $class_name)
 
 isRegistered (string $class_name)
 

Protected Member Functions

 registerInternal (array $providers)
 

Protected Attributes

 $all_providers
 

Private Attributes

 $main_bar_providers = []
 
 $main_menu_item_information = null
 

Detailed Description

Class ProviderFactory.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 13 of file ProviderFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\GlobalScreen\Provider\ProviderFactory::__construct ( array  $main_bar_providers,
ItemInformation  $main_menu_item_information 
)

ProviderFactory constructor.

Parameters
array$main_bar_providers
ItemInformation$main_menu_item_information

Definition at line 36 of file ProviderFactory.php.

References ILIAS\GlobalScreen\Provider\ProviderFactory\$main_bar_providers, ILIAS\GlobalScreen\Provider\ProviderFactory\$main_menu_item_information, and ILIAS\GlobalScreen\Provider\ProviderFactory\registerInternal().

+ Here is the call graph for this function:

Member Function Documentation

◆ getMainBarItemInformation()

ILIAS\GlobalScreen\Provider\ProviderFactory::getMainBarItemInformation ( )

◆ getMainBarProvider()

ILIAS\GlobalScreen\Provider\ProviderFactory::getMainBarProvider ( )

@inheritDoc

Implements ILIAS\GlobalScreen\Provider\ProviderFactoryInterface.

Reimplemented in ilGSProviderFactory.

Definition at line 62 of file ProviderFactory.php.

62 : array
63 {
65 }

References ILIAS\GlobalScreen\Provider\ProviderFactory\$main_bar_providers.

◆ getProviderByClassName()

ILIAS\GlobalScreen\Provider\ProviderFactory::getProviderByClassName ( string  $class_name)

@inheritDoc

Implements ILIAS\GlobalScreen\Provider\ProviderFactoryInterface.

Definition at line 80 of file ProviderFactory.php.

80 : Provider
81 {
82 if (!$this->isInstanceCreationPossible($class_name) || !$this->isRegistered($class_name)) {
83 throw new \LogicException("the GlobalScreen-Provider $class_name is not available");
84 }
85
86 return $this->all_providers[$class_name];
87 }
isRegistered(string $class_name)
@inheritDoc
isInstanceCreationPossible(string $class_name)
@inheritDoc

References ILIAS\GlobalScreen\Provider\ProviderFactory\isInstanceCreationPossible(), and ILIAS\GlobalScreen\Provider\ProviderFactory\isRegistered().

+ Here is the call graph for this function:

◆ isInstanceCreationPossible()

ILIAS\GlobalScreen\Provider\ProviderFactory::isInstanceCreationPossible ( string  $class_name)

@inheritDoc

Implements ILIAS\GlobalScreen\Provider\ProviderFactoryInterface.

Definition at line 93 of file ProviderFactory.php.

93 : bool
94 {
95 return class_exists($class_name);
96 }

Referenced by ILIAS\GlobalScreen\Provider\ProviderFactory\getProviderByClassName().

+ Here is the caller graph for this function:

◆ isRegistered()

ILIAS\GlobalScreen\Provider\ProviderFactory::isRegistered ( string  $class_name)

@inheritDoc

Implements ILIAS\GlobalScreen\Provider\ProviderFactoryInterface.

Definition at line 102 of file ProviderFactory.php.

102 : bool
103 {
104 return isset($this->all_providers[$class_name]);
105 }

Referenced by ILIAS\GlobalScreen\Provider\ProviderFactory\getProviderByClassName().

+ Here is the caller graph for this function:

◆ registerInternal()

ILIAS\GlobalScreen\Provider\ProviderFactory::registerInternal ( array  $providers)
protected
Parameters
array$providers

Definition at line 48 of file ProviderFactory.php.

49 {
50 array_walk(
51 $providers,
52 function (Provider $item) {
53 $this->all_providers[get_class($item)] = $item;
54 }
55 );
56 }

Referenced by ILIAS\GlobalScreen\Provider\ProviderFactory\__construct(), and ilGSProviderFactory\getMainBarProvider().

+ Here is the caller graph for this function:

Field Documentation

◆ $all_providers

ILIAS\GlobalScreen\Provider\ProviderFactory::$all_providers
protected

Definition at line 27 of file ProviderFactory.php.

◆ $main_bar_providers

ILIAS\GlobalScreen\Provider\ProviderFactory::$main_bar_providers = []
private

◆ $main_menu_item_information

ILIAS\GlobalScreen\Provider\ProviderFactory::$main_menu_item_information = null
private

The documentation for this class was generated from the following file: