ILIAS  release_8 Revision v8.23
ilDidacticTemplateExcludeFilterPattern Class Reference

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

+ Inheritance diagram for ilDidacticTemplateExcludeFilterPattern:
+ Collaboration diagram for ilDidacticTemplateExcludeFilterPattern:

Public Member Functions

 __construct (int $a_pattern_id=0)
 
 valid (string $a_source)
 Check if patttern matches. More...
 
 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.ilDidacticTemplateExcludeFilterPattern.php.

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateExcludeFilterPattern::__construct ( int  $a_pattern_id = 0)

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

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

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

Member Function Documentation

◆ toXml()

ilDidacticTemplateExcludeFilterPattern::toXml ( ilXmlWriter  $writer)

Definition at line 33 of file class.ilDidacticTemplateExcludeFilterPattern.php.

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

33  : void
34  {
35  switch ($this->getPatternSubType()) {
37  default:
38 
39  $writer->xmlElement(
40  'excludePattern',
41  [
42  'preg' => $this->getPattern()
43  ]
44  );
45  }
46  }
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()

ilDidacticTemplateExcludeFilterPattern::valid ( string  $a_source)

Check if patttern matches.

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

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

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

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