ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 25 of file class.ilPluginSlotInfo.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

Member Function Documentation

◆ getActivePlugins()

ilPluginSlotInfo::getActivePlugins ( )
Returns
Iterator <ilPluginInfo>

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

References XapiProxy\$plugin, and getPlugins().

Referenced by hasActivePlugins().

123  : Iterator
124  {
125  foreach ($this->getPlugins() as $id => $plugin) {
126  if ($plugin->isActive()) {
127  yield $id => $plugin;
128  }
129  }
130  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComponent()

ilPluginSlotInfo::getComponent ( )

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

References $component.

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

◆ getId()

ilPluginSlotInfo::getId ( )

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

References $id.

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

◆ getName()

ilPluginSlotInfo::getName ( )

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

References $name.

Referenced by getQualifiedName().

57  : string
58  {
59  return $this->name;
60  }
+ Here is the caller graph for this function:

◆ getPluginById()

ilPluginSlotInfo::getPluginById ( string  $id)
Exceptions

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

References $id, and hasPluginId().

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

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

108  : \ilPluginInfo
109  {
110  foreach ($this->getPlugins() as $plugin) {
111  if ($plugin->getName() === $name) {
112  return $plugin;
113  }
114  }
115  throw new \InvalidArgumentException(
116  "No plugin with name $name in slot {$this->getQualifiedName()}."
117  );
118  }
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 70 of file class.ilPluginSlotInfo.php.

References XapiProxy\$plugin.

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

70  : Iterator
71  {
72  foreach ($this->plugins as $id => $plugin) {
73  yield $id => $plugin;
74  }
75  }
+ Here is the caller graph for this function:

◆ getQualifiedName()

ilPluginSlotInfo::getQualifiedName ( )

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

References getName().

62  : string
63  {
64  return $this->component->getQualifiedName() . "/" . $this->getName();
65  }
+ Here is the call graph for this function:

◆ hasActivePlugins()

ilPluginSlotInfo::hasActivePlugins ( )

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

References getActivePlugins().

132  : bool
133  {
134  foreach ($this->getActivePlugins() as $_) {
135  return true;
136  }
137  return false;
138  }
+ Here is the call graph for this function:

◆ hasPluginId()

ilPluginSlotInfo::hasPluginId ( string  $id)

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

Referenced by getPluginById().

77  : bool
78  {
79  return isset($this->plugins[$id]);
80  }
+ Here is the caller graph for this function:

◆ hasPluginName()

ilPluginSlotInfo::hasPluginName ( string  $name)

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

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

95  : bool
96  {
97  foreach ($this->getPlugins() as $plugin) {
98  if ($plugin->getName() === $name) {
99  return true;
100  }
101  }
102  return false;
103  }
+ Here is the call graph for this function:

Field Documentation

◆ $component

ilComponentInfo ilPluginSlotInfo::$component
protected

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

Referenced by __construct(), and getComponent().

◆ $id

string ilPluginSlotInfo::$id
protected

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

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

◆ $name

string ilPluginSlotInfo::$name
protected

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

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

◆ $plugins

array ilPluginSlotInfo::$plugins
protected

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

Referenced by __construct().


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