ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ilDidacticTemplateFilterPatternFactory Class Reference

Factory for didactic template filter patterns. More...

+ Collaboration diagram for ilDidacticTemplateFilterPatternFactory:

Static Public Member Functions

static lookupPatternsByParentId (int $a_parent_id, string $a_parent_type)
 

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 ( int  $a_parent_id,
string  $a_parent_type 
)
static

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

13 : array
14 {
15 global $DIC;
16
17 $ilDB = $DIC->database();
18
19 $query = 'SELECT pattern_id,pattern_type FROM didactic_tpl_fp ' .
20 'WHERE parent_id = ' . $ilDB->quote($a_parent_id, ilDBConstants::T_INTEGER) . ' ' .
21 'AND parent_type = ' . $ilDB->quote($a_parent_type, 'text');
22 $res = $ilDB->query($query);
23
24 $patterns = [];
25 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
26 switch ($row->pattern_type) {
28
29 $patterns[] = new ilDidacticTemplateIncludeFilterPattern((int) $row->pattern_id);
30 break;
31
33
34 $patterns[] = new ilDidacticTemplateExcludeFilterPattern((int) $row->pattern_id);
35 break;
36 }
37 }
38
39 return $patterns;
40 }
Implementation of an include filter pattern for didactic template actions.
Implementation of an include filter pattern for didactic template actions.
global $DIC
Definition: feed.php:28
$res
Definition: ltiservices.php:69
$query

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

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: