ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 46 of file class.ilDidacticTemplateIncludeFilterPattern.php.

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

47  {
48  switch($this->getPatternSubType())
49  {
51  default:
52 
53  $writer->xmlElement(
54  'includePattern',
55  array(
56  'preg' => $this->getPattern()
57  )
58  );
59  }
60  }
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
Create styles array
The data for the language used.
+ 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  {
35  case self::PATTERN_SUBTYPE_REGEX:
36  ilLoggerFactory::getLogger('otpl')->debug('Checking include pattern with '.$a_source.' against '.$this->getPattern());
37  return preg_match('/'.$this->getPattern().'/',$a_source) === 1;
38  }
39  return false;
40  }
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: