ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 Get xml representation of pattern. More...
 
- 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.ilDidacticTemplateExcludeFilterPattern.php.

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateExcludeFilterPattern::__construct ( int  $a_pattern_id = 0)

Reimplemented from ilDidacticTemplateFilterPattern.

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

28 {
29 parent::__construct($a_pattern_id);
30 $this->setPatternType(self::PATTERN_EXCLUDE);
31 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ toXml()

ilDidacticTemplateExcludeFilterPattern::toXml ( ilXmlWriter  $writer)

Get xml representation of pattern.

Parameters
ilXmlWriter$writer
Returns
string

Reimplemented from ilDidacticTemplateFilterPattern.

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

47 : void
48 {
49 switch ($this->getPatternSubType()) {
51 default:
52
53 $writer->xmlElement(
54 'excludePattern',
55 [
56 'preg' => $this->getPattern()
57 ]
58 );
59 }
60 }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)

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

+ Here is the call graph for this function:

◆ valid()

ilDidacticTemplateExcludeFilterPattern::valid ( string  $a_source)

Check if patttern matches.

Reimplemented from ilDidacticTemplateFilterPattern.

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

36 : bool
37 {
38 $a_source = trim($a_source);
39 switch ($this->getPatternSubType()) {
41 $this->logger->debug('Checking exclude pattern with ' . $a_source . ' against ' . $this->getPattern());
42 return preg_match('/' . $this->getPattern() . '/', $a_source) !== 1;
43 }
44 return true;
45 }

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

+ Here is the call graph for this function:

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