ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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  }

Member Function Documentation

◆ getComponent()

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

Definition at line 45 of file OfComponent.php.

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.

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

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

50  : string
51  {
52  return get_class($this->getComponent());
53  }
+ 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.

References Vendor\Package\$d.

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  }

◆ getInDependenciesOf()

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

Definition at line 66 of file OfComponent.php.

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

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

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  }
+ 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.

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

Referenced by ILIAS\Component\Dependencies\Renderer\renderEntryPoints().

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

References Vendor\Package\$d.

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

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: