ILIAS  release_8 Revision v8.24
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.

13 {
14 switch ($a_action_type) {
17
20
23
24 default:
25 throw new InvalidArgumentException('Unknown action type given: ' . $a_action_type);
26 }
27 }
Abstract class for template actions.
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

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

◆ factoryByTypeAndId()

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

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

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 }

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

Referenced by getActionsByTemplateId().

+ Here is the caller graph for this function:

◆ 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.

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 }
static factoryByTypeAndId(int $a_action_id, int $a_action_type)
global $DIC
Definition: feed.php:28
$res
Definition: ltiservices.php:69
$query

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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