ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 25 of file class.ilDidacticTemplateIncludeFilterPattern.php.

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateIncludeFilterPattern::__construct ( int  $a_pattern_id = 0)

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

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

28  {
29  parent::__construct($a_pattern_id);
30  $this->setPatternType(self::PATTERN_INCLUDE);
31  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ toXml()

ilDidacticTemplateIncludeFilterPattern::toXml ( ilXmlWriter  $writer)

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

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

44  : void
45  {
46  switch ($this->getPatternSubType()) {
48  default:
49 
50  $writer->xmlElement(
51  'includePattern',
52  [
53  'preg' => $this->getPattern()
54  ]
55  );
56  }
57  }
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 33 of file class.ilDidacticTemplateIncludeFilterPattern.php.

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

33  : bool
34  {
35  $a_source = trim($a_source);
36  switch ($this->getPatternSubType()) {
37  case self::PATTERN_SUBTYPE_REGEX:
38  $this->logger->debug('Checking include pattern with ' . $a_source . ' against ' . $this->getPattern());
39  return preg_match('/' . $this->getPattern() . '/', $a_source) === 1;
40  }
41  return false;
42  }
+ Here is the call graph for this function:

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