ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilDidacticTemplateFilterPattern\PATTERN_EXCLUDE, and ilDidacticTemplateFilterPattern\PATTERN_INCLUDE.

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

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
Implementation of an include filter pattern for didactic template actions.
$row
global $ilDB
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: