ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 24 of file class.ilDidacticTemplateActionFactory.php.

Member Function Documentation

◆ factoryByType()

static ilDidacticTemplateActionFactory::factoryByType ( int  $a_action_type)
static

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

27 {
28 switch ($a_action_type) {
31
34
37
38 default:
39 throw new InvalidArgumentException('Unknown action type given: ' . $a_action_type);
40 }
41 }
Abstract class for template actions.
Description of ilDidacticTemplateBlockRoleAction.
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 43 of file class.ilDidacticTemplateActionFactory.php.

44 {
45 switch ($a_action_type) {
47 return new ilDidacticTemplateLocalPolicyAction($a_action_id);
48
50 return new ilDidacticTemplateLocalRoleAction($a_action_id);
51
53 return new ilDidacticTemplateBlockRoleAction($a_action_id);
54
55 default:
56 throw new InvalidArgumentException('Unknown action type given: ' . $a_action_type);
57 }
58 }

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 65 of file class.ilDidacticTemplateActionFactory.php.

65 : array
66 {
67 global $DIC;
68
69 $ilDB = $DIC->database();
70
71 $query = 'SELECT id, type_id FROM didactic_tpl_a ' .
72 'WHERE tpl_id = ' . $ilDB->quote($a_tpl_id, \ilDBConstants::T_INTEGER);
73 $res = $ilDB->query($query);
74
75 $actions = [];
76 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
77 $actions[] = self::factoryByTypeAndId((int) $row->id, (int) $row->type_id);
78 }
79 return $actions;
80 }
static factoryByTypeAndId(int $a_action_id, int $a_action_type)
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26

References $DIC, $ilDB, $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: