ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 ()
 
 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 122 of file class.ilPluginSlotInfo.php.

References XapiProxy\$plugin, and getPlugins().

Referenced by hasActivePlugins().

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

◆ getPluginById()

ilPluginSlotInfo::getPluginById ( string  $id)
Exceptions

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

References $id, and hasPluginId().

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

◆ getPluginByName()

ilPluginSlotInfo::getPluginByName ( string  $name)
Exceptions

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

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

107  : \ilPluginInfo
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  }
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 69 of file class.ilPluginSlotInfo.php.

References XapiProxy\$plugin.

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

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

◆ getQualifiedName()

ilPluginSlotInfo::getQualifiedName ( )

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

References getName().

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

◆ hasActivePlugins()

ilPluginSlotInfo::hasActivePlugins ( )

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

References getActivePlugins().

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

◆ hasPluginId()

ilPluginSlotInfo::hasPluginId ( string  $id)

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

Referenced by getPluginById().

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

◆ hasPluginName()

ilPluginSlotInfo::hasPluginName ( string  $name)

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

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

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