ILIAS  release_8 Revision v8.24
class.ilEventDefinitionProcessor.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22{
23 protected ilDBInterface $db;
24 protected ?string $component;
25
26 public function __construct(ilDBInterface $db)
27 {
28 $this->db = $db;
29 }
30
31 public function purge(): void
32 {
33 $this->db->manipulate("DELETE FROM il_event_handling WHERE component NOT LIKE 'Plugins/%'");
34 }
35
36 public function beginComponent(string $component, string $type): void
37 {
38 $this->component = $type . "/" . $component;
39 }
40
41 public function endComponent(string $component, string $type): void
42 {
43 $this->component = null;
44 }
45
46 public function beginTag(string $name, array $attributes): 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 }
62
63 public function endTag(string $name): void
64 {
65 }
66}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
beginComponent(string $component, string $type)
This method is called when parsing of component.xml for the given component starts.
endComponent(string $component, string $type)
This method is called when parsing of component.xml for the given component ends.
endTag(string $name)
This is called when a tag ends in the context of the given component.
purge()
This methods is supposed to purge existing data in the provider of the component, so new components c...
beginTag(string $name, array $attributes)
This is called when a tag starts in the context of the given component.
An ilComponentDefinitionProcessor processes some attributes from a component.xml (i....
Interface ilDBInterface.
if($format !==null) $name
Definition: metadata.php:247
$attributes
Definition: metadata.php:248
$type