ILIAS  release_7 Revision v7.30-3-g800a261c036
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.

19 {
20 global $DIC;
21
22 $ilDB = $DIC['ilDB'];
23
24 $query = 'SELECT pattern_id,pattern_type FROM didactic_tpl_fp ' .
25 'WHERE parent_id = ' . $ilDB->quote($a_parent_id) . ' ' .
26 'AND parent_type = ' . $ilDB->quote($a_parent_type, 'text');
27 $res = $ilDB->query($query);
28
29 $patterns = array();
30 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
31 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPattern.php';
32 switch ($row->pattern_type) {
34 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateIncludeFilterPattern.php';
35 $patterns[] = new ilDidacticTemplateIncludeFilterPattern($row->pattern_id);
36 break;
37
39 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateExcludeFilterPattern.php';
40 $patterns[] = new ilDidacticTemplateExcludeFilterPattern($row->pattern_id);
41 break;
42 }
43 }
44 return $patterns;
45 }
Implementation of an include filter pattern for didactic template actions.
Implementation of an include filter pattern for didactic template actions.
global $DIC
Definition: goto.php:24
$query
foreach($_POST as $key=> $value) $res
global $ilDB

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilDidacticTemplateFilterPattern\PATTERN_EXCLUDE, and ilDidacticTemplateFilterPattern\PATTERN_INCLUDE.

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

+ Here is the caller graph for this function:

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