ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSystemCheckDefinitionProcessor 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 ilSystemCheckDefinitionProcessor:
+ Collaboration diagram for ilSystemCheckDefinitionProcessor:

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_id
 

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 20 of file class.ilSystemCheckDefinitionProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ilSystemCheckDefinitionProcessor::__construct ( \ilDBInterface  $db)

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

References $db.

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

Member Function Documentation

◆ beginComponent()

ilSystemCheckDefinitionProcessor::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 34 of file class.ilSystemCheckDefinitionProcessor.php.

34  : void
35  {
36  $this->component_id = null;
37  }

◆ beginTag()

ilSystemCheckDefinitionProcessor::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 44 of file class.ilSystemCheckDefinitionProcessor.php.

References ilSCGroups\getInstance(), and ilSCTasks\getInstanceByGroupId().

44  : void
45  {
46  if ($name === "module" || $name === "service") {
47  $this->component_id = $attributes["id"] ?? null;
48  return;
49  }
50  if ($name !== "systemcheck" || $name !== "systemcheck_task") {
51  return;
52  }
53  if ($this->component_id === null) {
54  throw new \RuntimeException(
55  "Found $name-tag outside of module or service."
56  );
57  }
58 
59  if ($name === "systemcheck") {
60  ilSCGroups::getInstance()->updateFromComponentDefinition($this->component_id);
61  }
62  if ($name === "systemcheck_task") {
63  $group_id = ilSCGroups::getInstance()->lookupGroupByComponentId($this->component_id);
64  $tasks = ilSCTasks::getInstanceByGroupId($group_id);
65  $tasks->updateFromComponentDefinition((string) ($attributes['identifier'] ?? ''));
66  }
67  }
$attributes
Definition: metadata.php:248
static getInstanceByGroupId(int $a_group_id)
if($format !==null) $name
Definition: metadata.php:247
static getInstance()
+ Here is the call graph for this function:

◆ endComponent()

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

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

Implements ilComponentDefinitionProcessor.

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

39  : void
40  {
41  $this->component_id = null;
42  }

◆ endTag()

ilSystemCheckDefinitionProcessor::endTag ( string  $name)

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

Implements ilComponentDefinitionProcessor.

Definition at line 69 of file class.ilSystemCheckDefinitionProcessor.php.

69  : void
70  {
71  if ($name === "module" || $name === "service") {
72  $this->component_id = null;
73  }
74  }
if($format !==null) $name
Definition: metadata.php:247

◆ purge()

ilSystemCheckDefinitionProcessor::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 30 of file class.ilSystemCheckDefinitionProcessor.php.

30  : void
31  {
32  }

Field Documentation

◆ $component_id

string ilSystemCheckDefinitionProcessor::$component_id
protected

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

◆ $db

ilDBInterface ilSystemCheckDefinitionProcessor::$db
protected

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

Referenced by __construct().


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