ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDidacticTemplateActionFactory Class Reference

Factory for didactic template actions. More...

+ Collaboration diagram for ilDidacticTemplateActionFactory:

Static Public Member Functions

static factoryByType (int $a_action_type)
 
static factoryByTypeAndId (int $a_action_id, int $a_action_type)
 
static getActionsByTemplateId (int $a_tpl_id)
 Get actions of one template. More...
 

Detailed Description

Factory for didactic template actions.

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

Definition at line 10 of file class.ilDidacticTemplateActionFactory.php.

Member Function Documentation

◆ factoryByType()

static ilDidacticTemplateActionFactory::factoryByType ( int  $a_action_type)
static

Definition at line 12 of file class.ilDidacticTemplateActionFactory.php.

References ilDidacticTemplateAction\TYPE_BLOCK_ROLE, ilDidacticTemplateAction\TYPE_LOCAL_POLICY, and ilDidacticTemplateAction\TYPE_LOCAL_ROLE.

13  {
14  switch ($a_action_type) {
17 
20 
23 
24  default:
25  throw new InvalidArgumentException('Unknown action type given: ' . $a_action_type);
26  }
27  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
represents a creation of local roles action
Abstract class for template actions.

◆ factoryByTypeAndId()

static ilDidacticTemplateActionFactory::factoryByTypeAndId ( int  $a_action_id,
int  $a_action_type 
)
static

Definition at line 29 of file class.ilDidacticTemplateActionFactory.php.

References ilDidacticTemplateAction\TYPE_BLOCK_ROLE, ilDidacticTemplateAction\TYPE_LOCAL_POLICY, and ilDidacticTemplateAction\TYPE_LOCAL_ROLE.

30  {
31  switch ($a_action_type) {
33  return new ilDidacticTemplateLocalPolicyAction($a_action_id);
34 
36  return new ilDidacticTemplateLocalRoleAction($a_action_id);
37 
39  return new ilDidacticTemplateBlockRoleAction($a_action_id);
40 
41  default:
42  throw new InvalidArgumentException('Unknown action type given: ' . $a_action_type);
43  }
44  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
represents a creation of local roles action
Abstract class for template actions.

◆ getActionsByTemplateId()

static ilDidacticTemplateActionFactory::getActionsByTemplateId ( int  $a_tpl_id)
static

Get actions of one template.

Parameters
int$a_tpl_id
Returns
ilDidacticTemplateAction[]

Definition at line 51 of file class.ilDidacticTemplateActionFactory.php.

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

Referenced by ilObject\applyDidacticTemplate(), ilRbacAdmin\applyMovedObjectDidacticTemplates(), ilDidacticTemplateSetting\delete(), ilDidacticTemplateCopier\start(), ilDidacticTemplateUtils\switchTemplate(), and ilDidacticTemplateSetting\toXml().

51  : array
52  {
53  global $DIC;
54 
55  $ilDB = $DIC->database();
56 
57  $query = 'SELECT id, type_id FROM didactic_tpl_a ' .
58  'WHERE tpl_id = ' . $ilDB->quote($a_tpl_id, \ilDBConstants::T_INTEGER);
59  $res = $ilDB->query($query);
60 
61  $actions = [];
62  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
63  $actions[] = self::factoryByTypeAndId((int) $row->id, (int) $row->type_id);
64  }
65  return $actions;
66  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

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