ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ($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 13 of file class.ilDidacticTemplateIncludeFilterPattern.php.

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateIncludeFilterPattern::__construct (   $a_pattern_id = 0)

Constructor.

Parameters
int$a_pattern_id

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

References ilDidacticTemplateFilterPattern\setPatternType().

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

Member Function Documentation

◆ toXml()

ilDidacticTemplateIncludeFilterPattern::toXml ( ilXmlWriter  $writer)

Write xml.

Parameters
ilXmlWriter$writer

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

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

46  {
47  switch ($this->getPatternSubType()) {
49  default:
50 
51  $writer->xmlElement(
52  'includePattern',
53  array(
54  'preg' => $this->getPattern()
55  )
56  );
57  }
58  }
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()

ilDidacticTemplateIncludeFilterPattern::valid (   $a_source)

Check if patttern matches.

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

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

30  {
31  $a_source = trim($a_source);
32 
33  switch ($this->getPatternSubType()) {
34  case self::PATTERN_SUBTYPE_REGEX:
35  ilLoggerFactory::getLogger('otpl')->debug('Checking include pattern with ' . $a_source . ' against ' . $this->getPattern());
36  return preg_match('/' . $this->getPattern() . '/', $a_source) === 1;
37  }
38  return false;
39  }
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: