ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilEventHandlingDefinitionProcessor Class Reference
+ Inheritance diagram for ilEventHandlingDefinitionProcessor:
+ Collaboration diagram for ilEventHandlingDefinitionProcessor:

Public Member Functions

 getData ()
 
 purge ()
 This methods is supposed to purge existing data in the provider of the component, so new components can be added to a clean slate. More...
 
 beginComponent (string $component, string $type)
 This method is called when parsing of component.xml for the given component starts. More...
 
 endComponent (string $component, string $type)
 This method is called when parsing of component.xml for the given component ends. More...
 
 beginTag (string $name, array $attributes)
 This is called when a tag starts in the context of the given component. More...
 
 endTag (string $name)
 This is called when a tag ends in the context of the given component. More...
 
 hasDataEntryForEvent ($event)
 

Protected Attributes

array $data = []
 
string $component
 

Detailed Description

Author
Klees

Definition at line 24 of file class.ilEventHandlingDefinitionProcessor.php.

Member Function Documentation

◆ beginComponent()

ilEventHandlingDefinitionProcessor::beginComponent ( string  $component,
string  $type 
)

This method is called when parsing of component.xml for the given component starts.

This is supposed to reset any internal parsing state.

Implements ilComponentDefinitionProcessor.

Definition at line 39 of file class.ilEventHandlingDefinitionProcessor.php.

References $component.

39  : void
40  {
41  $this->component = $type . "/" . $component;
42  }

◆ beginTag()

ilEventHandlingDefinitionProcessor::beginTag ( string  $name,
array  $attributes 
)

This is called when a tag starts in the context of the given component.

Parameters
string[]$attributes

Implements ilComponentDefinitionProcessor.

Definition at line 49 of file class.ilEventHandlingDefinitionProcessor.php.

References $component, hasDataEntryForEvent(), and null.

49  : void
50  {
51  if ($name !== "event") {
52  return;
53  }
54 
55  $component = $attributes["component"] ?? null;
56  if (!$component) {
58  }
59 
60  $event = [
61  "component" => $component,
62  "type" => $attributes["type"],
63  "type_specification" => $attributes["id"]
64  ];
65 
66  // only add event to data if no such entry exists
67  if (!$this->hasDataEntryForEvent($event)) {
68  $this->data[] = $event;
69  }
70  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ endComponent()

ilEventHandlingDefinitionProcessor::endComponent ( string  $component,
string  $type 
)

This method is called when parsing of component.xml for the given component ends.

Implements ilComponentDefinitionProcessor.

Definition at line 44 of file class.ilEventHandlingDefinitionProcessor.php.

References null.

44  : void
45  {
46  $this->component = null;
47  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ endTag()

ilEventHandlingDefinitionProcessor::endTag ( string  $name)

This is called when a tag ends in the context of the given component.

Implements ilComponentDefinitionProcessor.

Definition at line 72 of file class.ilEventHandlingDefinitionProcessor.php.

72  : void
73  {
74  }

◆ getData()

ilEventHandlingDefinitionProcessor::getData ( )

Definition at line 29 of file class.ilEventHandlingDefinitionProcessor.php.

References $data.

◆ hasDataEntryForEvent()

ilEventHandlingDefinitionProcessor::hasDataEntryForEvent (   $event)

Definition at line 76 of file class.ilEventHandlingDefinitionProcessor.php.

Referenced by beginTag().

76  : bool
77  {
78  return in_array($event, $this->data, true);
79  }
+ Here is the caller graph for this function:

◆ purge()

ilEventHandlingDefinitionProcessor::purge ( )

This methods is supposed to purge existing data in the provider of the component, so new components can be added to a clean slate.

Implements ilComponentDefinitionProcessor.

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

34  : void
35  {
36  $this->data = [];
37  }

Field Documentation

◆ $component

string ilEventHandlingDefinitionProcessor::$component
protected

Definition at line 27 of file class.ilEventHandlingDefinitionProcessor.php.

Referenced by beginComponent(), and beginTag().

◆ $data

array ilEventHandlingDefinitionProcessor::$data = []
protected

Definition at line 26 of file class.ilEventHandlingDefinitionProcessor.php.

Referenced by getData().


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