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

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 24 of file class.ilArtifactEventHandlingData.php.

25 {
26 $this->event_handling_data = $this->readEventHandlingData();
27 }
readEventHandlingData()
Read the event data stored in the artifact.

References readEventHandlingData().

+ 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

InvalidArgumentException if event does not exist

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

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

References hasEvent().

+ Here is the call graph for this function:

◆ getEventsByType()

ilArtifactEventHandlingData::getEventsByType ( string  $type)

Get all events of the given type.

Exceptions

InvalidArgumentException if no events of this type exist

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

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

◆ hasEvent()

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

Check if an event exists.

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

41 : bool
42 {
43 return in_array(
44 [
45 "component" => $component,
46 "type" => $type,
47 "type_specification" => $type_specification
48 ],
49 $this->event_handling_data,
50 true
51 );
52 }

Referenced by getEvent().

+ 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 33 of file class.ilArtifactEventHandlingData.php.

33 : array
34 {
35 return require ilEventHandlingBuildEventInfoObjective::PATH();
36 }

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $event_handling_data

array ilArtifactEventHandlingData::$event_handling_data
protected

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


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