ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 25 of file class.ilDidacticTemplateFilterPatternFactory.php.

Member Function Documentation

◆ lookupPatternsByParentId()

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

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

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

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

27  : array
28  {
29  global $DIC;
30 
31  $ilDB = $DIC->database();
32 
33  $query = 'SELECT pattern_id,pattern_type FROM didactic_tpl_fp ' .
34  'WHERE parent_id = ' . $ilDB->quote($a_parent_id, ilDBConstants::T_INTEGER) . ' ' .
35  'AND parent_type = ' . $ilDB->quote($a_parent_type, 'text');
36  $res = $ilDB->query($query);
37 
38  $patterns = [];
39  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
40  switch ($row->pattern_type) {
42 
43  $patterns[] = new ilDidacticTemplateIncludeFilterPattern((int) $row->pattern_id);
44  break;
45 
47 
48  $patterns[] = new ilDidacticTemplateExcludeFilterPattern((int) $row->pattern_id);
49  break;
50  }
51  }
52 
53  return $patterns;
54  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
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: