ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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 }

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

Member Function Documentation

◆ getId()

ilComponentInfo::getId ( )

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

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

References $id.

◆ getName()

ilComponentInfo::getName ( )

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

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

References $name.

◆ getPluginSlotById()

ilComponentInfo::getPluginSlotById ( string  $id)
Exceptions

InvalidArgumentException if there is no such slot

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

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.

References $id.

◆ getPluginSlotByName()

ilComponentInfo::getPluginSlotByName ( string  $name)
Exceptions

InvalidArgumentException if there is no such slot

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

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 }

References $name.

◆ 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 }

References $id.

◆ getQualifiedName()

ilComponentInfo::getQualifiedName ( )

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

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

References $name.

◆ getType()

ilComponentInfo::getType ( )

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

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

References $type.

◆ hasPluginSlotId()

ilComponentInfo::hasPluginSlotId ( string  $id)

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

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

References $id.

◆ hasPluginSlotName()

ilComponentInfo::hasPluginSlotName ( string  $name)

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

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

References $name.

Field Documentation

◆ $id

string ilComponentInfo::$id
protected

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