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

Implementation of an include filter pattern for didactic template actions. More...

+ Inheritance diagram for ilDidacticTemplateIncludeFilterPattern:
+ Collaboration diagram for ilDidacticTemplateIncludeFilterPattern:

Public Member Functions

 __construct (int $a_pattern_id=0)
 
 valid (string $a_source)
 
 toXml (ilXmlWriter $writer)
 
- Public Member Functions inherited from ilDidacticTemplateFilterPattern
 __construct (int $a_pattern_id=0)
 
 setPatternId (int $a_id)
 
 getPatternId ()
 
 setParentId (int $a_id)
 
 getParentId ()
 
 setParentType (string $a_type)
 
 getParentType ()
 
 setPatternType (int $a_type)
 
 getPatternType ()
 
 setPatternSubType (int $a_subtype)
 
 getPatternSubType ()
 
 setPattern (string $a_pattern)
 
 getPattern ()
 
 valid (string $a_source)
 Check if pattern matches. More...
 
 toXml (ilXmlWriter $writer)
 Get xml representation of pattern. More...
 
 update ()
 Update pattern definition. More...
 
 save ()
 Create new pattern Returns new pattern id. More...
 
 delete ()
 
 __clone ()
 

Additional Inherited Members

- Data Fields inherited from ilDidacticTemplateFilterPattern
const PATTERN_INCLUDE = 1
 
const PATTERN_EXCLUDE = 2
 
const PATTERN_SUBTYPE_REGEX = 1
 
- Protected Member Functions inherited from ilDidacticTemplateFilterPattern
 read ()
 Read pattern definition from db. More...
 
- Protected Attributes inherited from ilDidacticTemplateFilterPattern
ilDBInterface $db
 
ilLogger $logger
 

Detailed Description

Implementation of an include filter pattern for didactic template actions.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 11 of file class.ilDidacticTemplateIncludeFilterPattern.php.

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateIncludeFilterPattern::__construct ( int  $a_pattern_id = 0)

Definition at line 13 of file class.ilDidacticTemplateIncludeFilterPattern.php.

References ILIAS\GlobalScreen\Provider\__construct(), and ilDidacticTemplateFilterPattern\setPatternType().

14  {
15  parent::__construct($a_pattern_id);
16  $this->setPatternType(self::PATTERN_INCLUDE);
17  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ toXml()

ilDidacticTemplateIncludeFilterPattern::toXml ( ilXmlWriter  $writer)

Definition at line 30 of file class.ilDidacticTemplateIncludeFilterPattern.php.

References ilDidacticTemplateFilterPattern\getPattern(), ilDidacticTemplateFilterPattern\getPatternSubType(), ilDidacticTemplateFilterPattern\PATTERN_SUBTYPE_REGEX, and ilXmlWriter\xmlElement().

30  : void
31  {
32  switch ($this->getPatternSubType()) {
34  default:
35 
36  $writer->xmlElement(
37  'includePattern',
38  [
39  'preg' => $this->getPattern()
40  ]
41  );
42  }
43  }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:

◆ valid()

ilDidacticTemplateIncludeFilterPattern::valid ( string  $a_source)

Definition at line 19 of file class.ilDidacticTemplateIncludeFilterPattern.php.

References ilDidacticTemplateFilterPattern\getPattern(), ilDidacticTemplateFilterPattern\getPatternSubType(), and ILIAS\Repository\logger().

19  : bool
20  {
21  $a_source = trim($a_source);
22  switch ($this->getPatternSubType()) {
23  case self::PATTERN_SUBTYPE_REGEX:
24  $this->logger->debug('Checking include pattern with ' . $a_source . ' against ' . $this->getPattern());
25  return preg_match('/' . $this->getPattern() . '/', $a_source) === 1;
26  }
27  return false;
28  }
+ Here is the call graph for this function:

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