ILIAS  release_8 Revision v8.24
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 ()
 
 getPath ()
 
 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 127 of file class.ilPluginSlotInfo.php.

127 : Iterator
128 {
129 foreach ($this->getPlugins() as $id => $plugin) {
130 if ($plugin->isActive()) {
131 yield $id => $plugin;
132 }
133 }
134 }

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:

◆ getPath()

ilPluginSlotInfo::getPath ( )

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

References getQualifiedName(), and ilComponentRepository\PLUGIN_BASE_PATH.

+ Here is the call graph for this function:

◆ getPluginById()

ilPluginSlotInfo::getPluginById ( string  $id)
Exceptions

InvalidArgumentException if plugin does not exist

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

90 {
91 if (!$this->hasPluginId($id)) {
92 throw new \InvalidArgumentException(
93 "No plugin $id in slot {$this->getQualifiedName()}."
94 );
95 }
96 return $this->plugins[$id];
97 }
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 112 of file class.ilPluginSlotInfo.php.

113 {
114 foreach ($this->getPlugins() as $plugin) {
115 if ($plugin->getName() === $name) {
116 return $plugin;
117 }
118 }
119 throw new \InvalidArgumentException(
120 "No plugin with name $name in slot {$this->getQualifiedName()}."
121 );
122 }

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

+ Here is the call graph for this function:

◆ getPlugins()

ilPluginSlotInfo::getPlugins ( )
Returns
Iterator <ilPluginInfo>

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

74 : Iterator
75 {
76 foreach ($this->plugins as $id => $plugin) {
77 yield $id => $plugin;
78 }
79 }

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().

Referenced by getPath().

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

◆ hasActivePlugins()

ilPluginSlotInfo::hasActivePlugins ( )

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

136 : bool
137 {
138 foreach ($this->getActivePlugins() as $_) {
139 return true;
140 }
141 return false;
142 }

References getActivePlugins().

+ Here is the call graph for this function:

◆ hasPluginId()

ilPluginSlotInfo::hasPluginId ( string  $id)

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

81 : bool
82 {
83 return isset($this->plugins[$id]);
84 }

References $id.

Referenced by getPluginById().

+ Here is the caller graph for this function:

◆ hasPluginName()

ilPluginSlotInfo::hasPluginName ( string  $name)

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

99 : bool
100 {
101 foreach ($this->getPlugins() as $plugin) {
102 if ($plugin->getName() === $name) {
103 return true;
104 }
105 }
106 return false;
107 }

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: