ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilComponentInfo Class Reference

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

+ Collaboration diagram for ilComponentInfo:

Public Member Functions

 __construct (string $id, string $type, string $name, array &$pluginslots)
 
 getId ()
 
 getType ()
 
 getName ()
 
 getQualifiedName ()
 
 getPluginSlots ()
 
 hasPluginSlotId (string $id)
 
 getPluginSlotById (string $id)
 
 hasPluginSlotName (string $name)
 
 getPluginSlotByName (string $name)
 

Data Fields

const TYPE_COMPONENT = "components/ILIAS"
 
const TYPE_MODULES = "Modules"
 
const TYPE_SERVICES = "Services"
 
const TYPES = [self::TYPE_COMPONENT]
 

Protected Attributes

string $id
 
string $type
 
string $name
 
array $pluginslots
 

Detailed Description

Simple value class for basic information about a component.

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

Constructor & Destructor Documentation

◆ __construct()

ilComponentInfo::__construct ( string  $id,
string  $type,
string  $name,
array &  $pluginslots 
)

Definition at line 40 of file class.ilComponentInfo.php.

References $id, $name, $pluginslots, and $type.

45  {
46  if (!in_array($type, self::TYPES)) {
47  throw new \InvalidArgumentException(
48  "Invalid component type: $type"
49  );
50  }
51 
52  $this->id = $id;
53  $this->type = $type;
54  $this->name = $name;
55  $this->pluginslots = &$pluginslots;
56  }

Member Function Documentation

◆ getId()

ilComponentInfo::getId ( )

Definition at line 58 of file class.ilComponentInfo.php.

References $id.

58  : string
59  {
60  return $this->id;
61  }

◆ getName()

ilComponentInfo::getName ( )

Definition at line 68 of file class.ilComponentInfo.php.

References $name.

68  : string
69  {
70  return $this->name;
71  }

◆ getPluginSlotById()

ilComponentInfo::getPluginSlotById ( string  $id)
Exceptions

Definition at line 101 of file class.ilComponentInfo.php.

References $id.

102  {
103  foreach ($this->pluginslots as $slot) {
104  if ($slot->getId() === $id) {
105  return $slot;
106  }
107  }
108  throw new \InvalidArgumentException(
109  "No plugin slot $id at component {$this->getQualifiedName()}"
110  );
111  }
Simple value class for basic information about a pluginslot.

◆ getPluginSlotByName()

ilComponentInfo::getPluginSlotByName ( string  $name)
Exceptions

Definition at line 126 of file class.ilComponentInfo.php.

References $name.

127  {
128  foreach ($this->pluginslots as $slot) {
129  if ($slot->getName() === $name) {
130  return $slot;
131  }
132  }
133  throw new \InvalidArgumentException(
134  "No plugin slot $name at component {$this->getQualifiedName()}"
135  );
136  }
Simple value class for basic information about a pluginslot.

◆ getPluginSlots()

ilComponentInfo::getPluginSlots ( )
Returns
Iterator <ilPluginSlotInfo>

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

81  : Iterator
82  {
83  foreach ($this->pluginslots as $id => $slot) {
84  yield $slot->getId() => $slot;
85  }
86  }

◆ getQualifiedName()

ilComponentInfo::getQualifiedName ( )

Definition at line 73 of file class.ilComponentInfo.php.

References $name.

73  : string
74  {
75  return $this->type . "/" . $this->name;
76  }

◆ getType()

ilComponentInfo::getType ( )

Definition at line 63 of file class.ilComponentInfo.php.

References $type.

63  : string
64  {
65  return $this->type;
66  }

◆ hasPluginSlotId()

ilComponentInfo::hasPluginSlotId ( string  $id)

Definition at line 88 of file class.ilComponentInfo.php.

References $id.

88  : bool
89  {
90  foreach ($this->pluginslots as $slot) {
91  if ($slot->getId() === $id) {
92  return true;
93  }
94  }
95  return false;
96  }

◆ hasPluginSlotName()

ilComponentInfo::hasPluginSlotName ( string  $name)

Definition at line 113 of file class.ilComponentInfo.php.

References $name.

113  : bool
114  {
115  foreach ($this->pluginslots as $slot) {
116  if ($slot->getName() === $name) {
117  return true;
118  }
119  }
120  return false;
121  }

Field Documentation

◆ $id

string ilComponentInfo::$id
protected

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

Referenced by __construct(), getId(), getPluginSlotById(), and hasPluginSlotId().

◆ $name

string ilComponentInfo::$name
protected

◆ $pluginslots

array ilComponentInfo::$pluginslots
protected

Definition at line 38 of file class.ilComponentInfo.php.

Referenced by __construct().

◆ $type

string ilComponentInfo::$type
protected

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

Referenced by __construct(), and getType().

◆ TYPE_COMPONENT

◆ TYPE_MODULES

const ilComponentInfo::TYPE_MODULES = "Modules"

◆ TYPE_SERVICES

const ilComponentInfo::TYPE_SERVICES = "Services"

◆ TYPES

const ilComponentInfo::TYPES = [self::TYPE_COMPONENT]

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