ILIAS  release_8 Revision v8.24
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 TYPES = ["Modules", "Services"]
 
const TYPE_MODULES = "Modules"
 
const TYPE_SERVICES = "Services"
 

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 39 of file class.ilComponentInfo.php.

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

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

Member Function Documentation

◆ getId()

ilComponentInfo::getId ( )

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

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

References $id.

◆ getName()

ilComponentInfo::getName ( )

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

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

References $name.

◆ getPluginSlotById()

ilComponentInfo::getPluginSlotById ( string  $id)
Exceptions

InvalidArgumentException if there is no such slot

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

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

References $id.

◆ getPluginSlotByName()

ilComponentInfo::getPluginSlotByName ( string  $name)
Exceptions

InvalidArgumentException if there is no such slot

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

126 {
127 foreach ($this->pluginslots as $slot) {
128 if ($slot->getName() === $name) {
129 return $slot;
130 }
131 }
132 throw new \InvalidArgumentException(
133 "No plugin slot $name at component {$this->getQualifiedName()}"
134 );
135 }

References $name.

◆ getPluginSlots()

ilComponentInfo::getPluginSlots ( )
Returns
Iterator <ilPluginSlotInfo>

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

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

References $id.

◆ getQualifiedName()

ilComponentInfo::getQualifiedName ( )

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

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

References $name.

◆ getType()

ilComponentInfo::getType ( )

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

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

References $type.

◆ hasPluginSlotId()

ilComponentInfo::hasPluginSlotId ( string  $id)

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

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

References $id.

◆ hasPluginSlotName()

ilComponentInfo::hasPluginSlotName ( string  $name)

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

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

References $name.

Field Documentation

◆ $id

string ilComponentInfo::$id
protected

◆ $name

string ilComponentInfo::$name
protected

◆ $pluginslots

array ilComponentInfo::$pluginslots
protected

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

Referenced by __construct().

◆ $type

string ilComponentInfo::$type
protected

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

Referenced by __construct(), and getType().

◆ TYPE_MODULES

◆ TYPE_SERVICES

const ilComponentInfo::TYPE_SERVICES = "Services"

◆ TYPES

const ilComponentInfo::TYPES = ["Modules", "Services"]

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