ILIAS  release_4-4 Revision
ilDidacticTemplateFilterPatternFactory Class Reference

Factory for didactic template filter patterns. More...

+ Collaboration diagram for ilDidacticTemplateFilterPatternFactory:

Static Public Member Functions

static lookupPatternsByParentId ($a_parent_id, $a_parent_type)
 Get patterns by template id. More...
 

Detailed Description

Factory for didactic template filter patterns.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 11 of file class.ilDidacticTemplateFilterPatternFactory.php.

Member Function Documentation

◆ lookupPatternsByParentId()

static ilDidacticTemplateFilterPatternFactory::lookupPatternsByParentId (   $a_parent_id,
  $a_parent_type 
)
static

Get patterns by template id.

Parameters
int$a_tpl_id
arrayArray of ilDidacticTemplateFilterPattern

Definition at line 18 of file class.ilDidacticTemplateFilterPatternFactory.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, ilDidacticTemplateFilterPattern\PATTERN_EXCLUDE, and ilDidacticTemplateFilterPattern\PATTERN_INCLUDE.

Referenced by ilDidacticTemplateAction\filterRoles(), ilDidacticTemplateBlockRoleAction\read(), and ilDidacticTemplateLocalPolicyAction\read().

19  {
20  global $ilDB;
21 
22  $query = 'SELECT pattern_id,pattern_type FROM didactic_tpl_fp '.
23  'WHERE parent_id = '.$ilDB->quote($a_parent_id).' '.
24  'AND parent_type = '.$ilDB->quote($a_parent_type,'text');
25  $res = $ilDB->query($query);
26 
27  $patterns = array();
28  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
29  {
30 
31  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPattern.php';
32  switch($row->pattern_type)
33  {
35  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateIncludeFilterPattern.php';
36  $patterns[] = new ilDidacticTemplateIncludeFilterPattern($row->pattern_id);
37  break;
38 
40  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateExcludeFilterPattern.php';
41  $patterns[] = new ilDidacticTemplateExcludeFilterPattern($row->pattern_id);
42  break;
43  }
44 
45  }
46  return $patterns;
47  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
Implementation of an include filter pattern for didactic template actions.
Implementation of an include filter pattern for didactic template actions.
+ Here is the caller graph for this function:

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