ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPluginSlotInfo Class Reference

Simple value class for basic information about a pluginslot. More...

+ Collaboration diagram for ilPluginSlotInfo:

Public Member Functions

 __construct (ilComponentInfo $component, string $id, string $name, array &$plugins)
 
 getComponent ()
 
 getId ()
 
 getName ()
 
 getQualifiedName ()
 
 getPlugins ()
 
 hasPluginId (string $id)
 
 getPluginById (string $id)
 
 hasPluginName (string $name)
 
 getPluginByName (string $name)
 
 getActivePlugins ()
 
 hasActivePlugins ()
 

Protected Attributes

ilComponentInfo $component
 
string $id
 
string $name
 
array $plugins
 

Detailed Description

Simple value class for basic information about a pluginslot.

Definition at line 24 of file class.ilPluginSlotInfo.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginSlotInfo::__construct ( ilComponentInfo  $component,
string  $id,
string  $name,
array &  $plugins 
)

Definition at line 34 of file class.ilPluginSlotInfo.php.

39 {
40 $this->component = $component;
41 $this->id = $id;
42 $this->name = $name;
43 $this->plugins = &$plugins;
44 }
ilComponentInfo $component

References $component, $id, $name, and $plugins.

Member Function Documentation

◆ getActivePlugins()

ilPluginSlotInfo::getActivePlugins ( )
Returns
Iterator <ilPluginInfo>

Definition at line 122 of file class.ilPluginSlotInfo.php.

122 : Iterator
123 {
124 foreach ($this->getPlugins() as $id => $plugin) {
125 if ($plugin->isActive()) {
126 yield $id => $plugin;
127 }
128 }
129 }

References $id, XapiProxy\$plugin, and getPlugins().

Referenced by hasActivePlugins().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponent()

ilPluginSlotInfo::getComponent ( )

Definition at line 46 of file class.ilPluginSlotInfo.php.

47 {
48 return $this->component;
49 }
Simple value class for basic information about a component.

References $component.

◆ getId()

ilPluginSlotInfo::getId ( )

Definition at line 51 of file class.ilPluginSlotInfo.php.

51 : string
52 {
53 return $this->id;
54 }

References $id.

◆ getName()

ilPluginSlotInfo::getName ( )

Definition at line 56 of file class.ilPluginSlotInfo.php.

56 : string
57 {
58 return $this->name;
59 }

References $name.

Referenced by getQualifiedName().

+ Here is the caller graph for this function:

◆ getPluginById()

ilPluginSlotInfo::getPluginById ( string  $id)
Exceptions

InvalidArgumentException if plugin does not exist

Definition at line 84 of file class.ilPluginSlotInfo.php.

85 {
86 if (!$this->hasPluginId($id)) {
87 throw new \InvalidArgumentException(
88 "No plugin $id in slot {$this->getQualifiedName()}."
89 );
90 }
91 return $this->plugins[$id];
92 }
Simple value class for information about a plugin.

References $id, and hasPluginId().

+ Here is the call graph for this function:

◆ getPluginByName()

ilPluginSlotInfo::getPluginByName ( string  $name)
Exceptions

InvalidArgumentException if plugin does not exist

Definition at line 107 of file class.ilPluginSlotInfo.php.

108 {
109 foreach ($this->getPlugins() as $plugin) {
110 if ($plugin->getName() === $name) {
111 return $plugin;
112 }
113 }
114 throw new \InvalidArgumentException(
115 "No plugin with name $name in slot {$this->getQualifiedName()}."
116 );
117 }

References $name, XapiProxy\$plugin, and getPlugins().

+ Here is the call graph for this function:

◆ getPlugins()

ilPluginSlotInfo::getPlugins ( )
Returns
Iterator <ilPluginInfo>

Definition at line 69 of file class.ilPluginSlotInfo.php.

69 : Iterator
70 {
71 foreach ($this->plugins as $id => $plugin) {
72 yield $id => $plugin;
73 }
74 }

References $id, and XapiProxy\$plugin.

Referenced by getActivePlugins(), getPluginByName(), and hasPluginName().

+ Here is the caller graph for this function:

◆ getQualifiedName()

ilPluginSlotInfo::getQualifiedName ( )

Definition at line 61 of file class.ilPluginSlotInfo.php.

61 : string
62 {
63 return $this->component->getQualifiedName() . "/" . $this->getName();
64 }

References getName().

+ Here is the call graph for this function:

◆ hasActivePlugins()

ilPluginSlotInfo::hasActivePlugins ( )

Definition at line 131 of file class.ilPluginSlotInfo.php.

131 : bool
132 {
133 foreach ($this->getActivePlugins() as $_) {
134 return true;
135 }
136 return false;
137 }

References getActivePlugins().

+ Here is the call graph for this function:

◆ hasPluginId()

ilPluginSlotInfo::hasPluginId ( string  $id)

Definition at line 76 of file class.ilPluginSlotInfo.php.

76 : bool
77 {
78 return isset($this->plugins[$id]);
79 }

References $id.

Referenced by getPluginById().

+ Here is the caller graph for this function:

◆ hasPluginName()

ilPluginSlotInfo::hasPluginName ( string  $name)

Definition at line 94 of file class.ilPluginSlotInfo.php.

94 : bool
95 {
96 foreach ($this->getPlugins() as $plugin) {
97 if ($plugin->getName() === $name) {
98 return true;
99 }
100 }
101 return false;
102 }

References $name, XapiProxy\$plugin, and getPlugins().

+ Here is the call graph for this function:

Field Documentation

◆ $component

ilComponentInfo ilPluginSlotInfo::$component
protected

Definition at line 26 of file class.ilPluginSlotInfo.php.

Referenced by __construct(), and getComponent().

◆ $id

string ilPluginSlotInfo::$id
protected

◆ $name

string ilPluginSlotInfo::$name
protected

Definition at line 28 of file class.ilPluginSlotInfo.php.

Referenced by __construct(), getName(), getPluginByName(), and hasPluginName().

◆ $plugins

array ilPluginSlotInfo::$plugins
protected

Definition at line 32 of file class.ilPluginSlotInfo.php.

Referenced by __construct().


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