ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

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

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

Member Function Documentation

◆ getActivePlugins()

ilPluginSlotInfo::getActivePlugins ( )
Returns
Iterator <ilPluginInfo>

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

References XapiProxy\$plugin, and getPlugins().

Referenced by hasActivePlugins().

127  : Iterator
128  {
129  foreach ($this->getPlugins() as $id => $plugin) {
130  if ($plugin->isActive()) {
131  yield $id => $plugin;
132  }
133  }
134  }
+ 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.

References $component.

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

◆ getId()

ilPluginSlotInfo::getId ( )

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

References $id.

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

◆ getName()

ilPluginSlotInfo::getName ( )

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

References $name.

Referenced by getQualifiedName().

56  : string
57  {
58  return $this->name;
59  }
+ 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.

66  : string
67  {
69  }
+ Here is the call graph for this function:

◆ getPluginById()

ilPluginSlotInfo::getPluginById ( string  $id)
Exceptions

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

References $id, and hasPluginId().

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.
+ Here is the call graph for this function:

◆ getPluginByName()

ilPluginSlotInfo::getPluginByName ( string  $name)
Exceptions

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

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

112  : \ilPluginInfo
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  }
Simple value class for information about a plugin.
+ Here is the call graph for this function:

◆ getPlugins()

ilPluginSlotInfo::getPlugins ( )
Returns
Iterator <ilPluginInfo>

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

References XapiProxy\$plugin.

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

74  : Iterator
75  {
76  foreach ($this->plugins as $id => $plugin) {
77  yield $id => $plugin;
78  }
79  }
+ Here is the caller graph for this function:

◆ getQualifiedName()

ilPluginSlotInfo::getQualifiedName ( )

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

References getName().

Referenced by getPath().

61  : string
62  {
63  return $this->component->getQualifiedName() . "/" . $this->getName();
64  }
+ 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.

References getActivePlugins().

136  : bool
137  {
138  foreach ($this->getActivePlugins() as $_) {
139  return true;
140  }
141  return false;
142  }
+ Here is the call graph for this function:

◆ hasPluginId()

ilPluginSlotInfo::hasPluginId ( string  $id)

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

Referenced by getPluginById().

81  : bool
82  {
83  return isset($this->plugins[$id]);
84  }
+ Here is the caller graph for this function:

◆ hasPluginName()

ilPluginSlotInfo::hasPluginName ( string  $name)

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

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

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

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

Referenced by __construct(), getId(), and getPluginById().

◆ $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: