ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilArtifactEventHandlingData Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilArtifactEventHandlingData:

Public Member Functions

 __construct ()
 
 hasEvent (string $component, string $type, string $type_specification)
 Check if an event exists. More...
 
 getEvent (string $component, string $type, string $type_specification)
 Get the event with the given component, type and type specification. More...
 
 getEventsByType (string $type)
 Get all events of the given type. More...
 

Data Fields

const EVENT_HANDLING_DATA_PATH = "./Services/EventHandling/artifacts/event_handling_data.php"
 

Protected Member Functions

 readEventHandlingData ()
 Read the event data stored in the artifact. More...
 

Protected Attributes

array $event_handling_data
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilArtifactEventHandlingData.php.

Constructor & Destructor Documentation

◆ __construct()

ilArtifactEventHandlingData::__construct ( )

Definition at line 25 of file class.ilArtifactEventHandlingData.php.

References readEventHandlingData().

26  {
27  $this->event_handling_data = $this->readEventHandlingData();
28  }
readEventHandlingData()
Read the event data stored in the artifact.
+ Here is the call graph for this function:

Member Function Documentation

◆ getEvent()

ilArtifactEventHandlingData::getEvent ( string  $component,
string  $type,
string  $type_specification 
)

Get the event with the given component, type and type specification.

Exceptions

Definition at line 59 of file class.ilArtifactEventHandlingData.php.

References hasEvent().

59  : array
60  {
61  if ($this->hasEvent($component, $type, $type_specification)) {
62  return [
63  "component" => $component,
64  "type" => $type,
65  "type_specification" => $type_specification
66  ];
67  }
68 
69  throw new \InvalidArgumentException(
70  "There is no event with the component \"" . $component . "\", type \"" . $type
71  . "\" and type specification \"" . $type_specification . "\"."
72  );
73  }
hasEvent(string $component, string $type, string $type_specification)
Check if an event exists.
+ Here is the call graph for this function:

◆ getEventsByType()

ilArtifactEventHandlingData::getEventsByType ( string  $type)

Get all events of the given type.

Exceptions

Definition at line 79 of file class.ilArtifactEventHandlingData.php.

79  : Iterator
80  {
81  foreach ($this->event_handling_data as $event_key => $event_values) {
82  if ($event_values["type"] == $type) {
83  yield $this->event_handling_data[$event_key];
84  }
85  }
86  }

◆ hasEvent()

ilArtifactEventHandlingData::hasEvent ( string  $component,
string  $type,
string  $type_specification 
)

Check if an event exists.

Definition at line 42 of file class.ilArtifactEventHandlingData.php.

Referenced by getEvent().

42  : bool
43  {
44  return in_array(
45  [
46  "component" => $component,
47  "type" => $type,
48  "type_specification" => $type_specification
49  ],
50  $this->event_handling_data,
51  true
52  );
53  }
+ Here is the caller graph for this function:

◆ readEventHandlingData()

ilArtifactEventHandlingData::readEventHandlingData ( )
protected

Read the event data stored in the artifact.

Returns
array

Definition at line 34 of file class.ilArtifactEventHandlingData.php.

Referenced by __construct().

34  : array
35  {
36  return require self::EVENT_HANDLING_DATA_PATH;
37  }
+ Here is the caller graph for this function:

Field Documentation

◆ $event_handling_data

array ilArtifactEventHandlingData::$event_handling_data
protected

Definition at line 23 of file class.ilArtifactEventHandlingData.php.

◆ EVENT_HANDLING_DATA_PATH

const ilArtifactEventHandlingData::EVENT_HANDLING_DATA_PATH = "./Services/EventHandling/artifacts/event_handling_data.php"

Definition at line 21 of file class.ilArtifactEventHandlingData.php.


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