ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Component\Dependencies\OfComponent Class Reference
+ Inheritance diagram for ILIAS\Component\Dependencies\OfComponent:
+ Collaboration diagram for ILIAS\Component\Dependencies\OfComponent:

Public Member Functions

 __construct (Component $component, Dependency ... $ds)
 
 getComponent ()
 
 getComponentName ()
 
 getInDependencies ()
 
 getInDependenciesOf (InType $type)
 
 getOutDependenciesOf (OutType $type)
 
 resetResolutions ()
 
 offsetExists ($dependency_description)
 
 offsetGet ($dependency_description)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 

Protected Attributes

Component $component
 
array $dependencies = []
 

Detailed Description

Definition at line 25 of file OfComponent.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Component\Dependencies\OfComponent::__construct ( Component  $component,
Dependency ...  $ds 
)

Definition at line 30 of file OfComponent.php.

31 {
32 $this->component = $component;
33
34 foreach ($ds as $d) {
35 if (!isset($this->dependencies[(string) $d])) {
36 $this->dependencies[(string) $d] = [];
37 }
38 $this->dependencies[(string) $d][] = $d;
39 if ($d instanceof Out) {
40 $d->setComponent($this);
41 }
42 }
43 }

References ILIAS\Component\Dependencies\OfComponent\$component, and Vendor\Package\$d.

Member Function Documentation

◆ getComponent()

ILIAS\Component\Dependencies\OfComponent::getComponent ( )

Definition at line 45 of file OfComponent.php.

45 : Component
46 {
47 return $this->component;
48 }

References ILIAS\Component\Dependencies\OfComponent\$component.

Referenced by ILIAS\Component\Dependencies\OfComponent\getComponentName().

+ Here is the caller graph for this function:

◆ getComponentName()

ILIAS\Component\Dependencies\OfComponent::getComponentName ( )

Definition at line 50 of file OfComponent.php.

50 : string
51 {
52 return get_class($this->getComponent());
53 }

References ILIAS\Component\Dependencies\OfComponent\getComponent().

Referenced by ILIAS\Component\Dependencies\Resolver\disambiguate(), and ILIAS\Component\Dependencies\Renderer\renderHeader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInDependencies()

ILIAS\Component\Dependencies\OfComponent::getInDependencies ( )

Definition at line 55 of file OfComponent.php.

55 : \Iterator
56 {
57 foreach ($this->dependencies as $d) {
58 foreach ($d as $i) {
59 if ($i instanceof In) {
60 yield $i;
61 }
62 }
63 }
64 }

References Vendor\Package\$d.

◆ getInDependenciesOf()

ILIAS\Component\Dependencies\OfComponent::getInDependenciesOf ( InType  $type)

Definition at line 66 of file OfComponent.php.

66 : \Iterator
67 {
68 foreach ($this->dependencies as $d) {
69 foreach ($d as $i) {
70 if ($i instanceof In && $i->getType() === $type) {
71 yield $i;
72 }
73 }
74 }
75 }

References Vendor\Package\$d, and ILIAS\Component\Dependencies\In\getType().

Referenced by ILIAS\Component\Dependencies\Renderer\renderEntryPointsSection(), and ILIAS\Component\Dependencies\Renderer\renderSeek().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOutDependenciesOf()

ILIAS\Component\Dependencies\OfComponent::getOutDependenciesOf ( OutType  $type)

Definition at line 77 of file OfComponent.php.

77 : \Iterator
78 {
79 foreach ($this->dependencies as $d) {
80 foreach ($d as $o) {
81 if ($o instanceof Out && $o->getType() === $type) {
82 yield $o;
83 }
84 }
85 }
86 }

References Vendor\Package\$d, and ILIAS\Component\Dependencies\Out\getType().

+ Here is the call graph for this function:

◆ offsetExists()

ILIAS\Component\Dependencies\OfComponent::offsetExists (   $dependency_description)

Definition at line 99 of file OfComponent.php.

99 : bool
100 {
101 return array_key_exists($dependency_description, $this->dependencies);
102 }

◆ offsetGet()

ILIAS\Component\Dependencies\OfComponent::offsetGet (   $dependency_description)

Definition at line 104 of file OfComponent.php.

104 : ?array
105 {
106 return $this->dependencies[$dependency_description];
107 }

◆ offsetSet()

ILIAS\Component\Dependencies\OfComponent::offsetSet (   $offset,
  $value 
)

Definition at line 109 of file OfComponent.php.

109 : void
110 {
111 throw new \LogicException(
112 "Cannot modify dependencies of component."
113 );
114 }

◆ offsetUnset()

ILIAS\Component\Dependencies\OfComponent::offsetUnset (   $offset)

Definition at line 116 of file OfComponent.php.

116 : void
117 {
118 throw new \LogicException(
119 "Cannot modify dependencies of component."
120 );
121 }

◆ resetResolutions()

ILIAS\Component\Dependencies\OfComponent::resetResolutions ( )

Definition at line 88 of file OfComponent.php.

88 : void
89 {
90 foreach ($this->dependencies as $d) {
91 foreach ($d as $o) {
92 $o->resetResolutions();
93 }
94 }
95 }

References Vendor\Package\$d.

Field Documentation

◆ $component

Component ILIAS\Component\Dependencies\OfComponent::$component
protected

◆ $dependencies

array ILIAS\Component\Dependencies\OfComponent::$dependencies = []
protected

Definition at line 28 of file OfComponent.php.


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