ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ($a_pattern_id=0)
 Constructor. More...
 
 valid ($a_source)
 Check if patttern matches. More...
 
 toXml (ilXmlWriter $writer)
 Write xml. More...
 
- Public Member Functions inherited from ilDidacticTemplateFilterPattern
 __construct ($a_pattern_id=0)
 Constructor. More...
 
 setPatternId ($a_id)
 set pattern id More...
 
 getPatternId ()
 Get pattern id. More...
 
 setParentId ($a_id)
 Set parent id. More...
 
 getParentId ()
 Get parent id. More...
 
 setParentType ($a_type)
 Set parent type. More...
 
 getParentType ()
 Get parent type. More...
 
 setPatternType ($a_type)
 Set pattern type. More...
 
 getPatterType ()
 Get pattern type. More...
 
 setPatternSubType ($a_subtype)
 Set pattern sub type. More...
 
 getPatternSubType ()
 Get pattern sub type. More...
 
 setPattern ($a_pattern)
 Set pattern. More...
 
 getPattern ()
 Get pattern. More...
 
 valid ($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 ilDB $ilDB. More...
 
 delete ()
 Delete pattern ilDB $ilDB. More...
 
 __clone ()
 Magic clone method. More...
 

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...
 

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 12 of file class.ilDidacticTemplateExcludeFilterPattern.php.

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateExcludeFilterPattern::__construct (   $a_pattern_id = 0)

Constructor.

Parameters
int$a_pattern_id

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

References ilDidacticTemplateFilterPattern\setPatternType().

20  {
21  parent::__construct($a_pattern_id);
22  $this->setPatternType(self::PATTERN_EXCLUDE);
23  }
+ Here is the call graph for this function:

Member Function Documentation

◆ toXml()

ilDidacticTemplateExcludeFilterPattern::toXml ( ilXmlWriter  $writer)

Write xml.

Parameters
ilXmlWriter$writer

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

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

45  {
46  switch ($this->getPatternSubType()) {
48  default:
49 
50  $writer->xmlElement(
51  'excludePattern',
52  array(
53  'preg' => $this->getPattern()
54  )
55  );
56  }
57  }
Create styles array
The data for the language used.
xmlElement($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 (   $a_source)

Check if patttern matches.

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

References ilLoggerFactory\getLogger(), ilDidacticTemplateFilterPattern\getPattern(), and ilDidacticTemplateFilterPattern\getPatternSubType().

29  {
30  $a_source = trim($a_source);
31 
32  switch ($this->getPatternSubType()) {
33  case self::PATTERN_SUBTYPE_REGEX:
34  ilLoggerFactory::getLogger('otpl')->debug('Checking exclude pattern with ' . $a_source . ' against ' . $this->getPattern());
35  return preg_match('/' . $this->getPattern() . '/', $a_source) !== 1;
36  }
37  return true;
38  }
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

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