ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilEventDefinitionProcessor Class Reference

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

+ Inheritance diagram for ilEventDefinitionProcessor:
+ Collaboration diagram for ilEventDefinitionProcessor:

Public Member Functions

 __construct (ilDBInterface $db)
 
 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...
 

Protected Attributes

ilDBInterface $db
 
string $component
 

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

Author
Klees

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

Constructor & Destructor Documentation

◆ __construct()

ilEventDefinitionProcessor::__construct ( ilDBInterface  $db)

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

References $db.

27  {
28  $this->db = $db;
29  }

Member Function Documentation

◆ beginComponent()

ilEventDefinitionProcessor::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 36 of file class.ilEventDefinitionProcessor.php.

References $component.

36  : void
37  {
38  $this->component = $type . "/" . $component;
39  }
$type

◆ beginTag()

ilEventDefinitionProcessor::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 46 of file class.ilEventDefinitionProcessor.php.

References $component.

46  : void
47  {
48  if ($name !== "event") {
49  return;
50  }
51 
52  $component = $attributes["component"] ?? null;
53  if (!$component) {
55  }
56  $q = "INSERT INTO il_event_handling (component, type, id) VALUES (" .
57  $this->db->quote($component, "text") . "," .
58  $this->db->quote($attributes["type"], "text") . "," .
59  $this->db->quote($attributes["id"], "text") . ")";
60  $this->db->manipulate($q);
61  }
$attributes
Definition: metadata.php:248
if($format !==null) $name
Definition: metadata.php:247

◆ endComponent()

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

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

Implements ilComponentDefinitionProcessor.

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

41  : void
42  {
43  $this->component = null;
44  }

◆ endTag()

ilEventDefinitionProcessor::endTag ( string  $name)

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

Implements ilComponentDefinitionProcessor.

Definition at line 63 of file class.ilEventDefinitionProcessor.php.

63  : void
64  {
65  }

◆ purge()

ilEventDefinitionProcessor::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 31 of file class.ilEventDefinitionProcessor.php.

31  : void
32  {
33  $this->db->manipulate("DELETE FROM il_event_handling WHERE component NOT LIKE 'Plugins/%'");
34  }

Field Documentation

◆ $component

string ilEventDefinitionProcessor::$component
protected

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

Referenced by beginComponent(), and beginTag().

◆ $db

ilDBInterface ilEventDefinitionProcessor::$db
protected

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

Referenced by __construct().


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