ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDidacticTemplateActionFactory Class Reference

Factory for didactic template actions. More...

+ Collaboration diagram for ilDidacticTemplateActionFactory:

Static Public Member Functions

static factoryByType ($a_action_type)
 Get action class by type.
static factoryByTypeAndId ($a_action_id, $a_action_type)
 Get instance by id and type.
static getActionsByTemplateId ($a_tpl_id)
 Get actions of one template.

Detailed Description

Factory for didactic template actions.

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

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

Member Function Documentation

static ilDidacticTemplateActionFactory::factoryByType (   $a_action_type)
static

Get action class by type.

Parameters
string$a_action_type
Returns
ilDidacticTemplateAction

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

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

{
switch($a_action_type)
{
include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateLocalPolicyAction.php';
include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateLocalRoleAction.php';
include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateBlockRoleAction.php';
}
}
static ilDidacticTemplateActionFactory::factoryByTypeAndId (   $a_action_id,
  $a_action_type 
)
static

Get instance by id and type.

Parameters
int$a_action_id
int$a_actions_type
Returns
ilDidacticTemplateLocalPolicyAction

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

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

Referenced by getActionsByTemplateId().

{
switch($a_action_type)
{
include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateLocalPolicyAction.php';
return new ilDidacticTemplateLocalPolicyAction($a_action_id);
include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateLocalRoleAction.php';
return new ilDidacticTemplateLocalRoleAction($a_action_id);
include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateBlockRoleAction.php';
return new ilDidacticTemplateBlockRoleAction($a_action_id);
}
}

+ Here is the caller graph for this function:

static ilDidacticTemplateActionFactory::getActionsByTemplateId (   $a_tpl_id)
static

Get actions of one template.

Parameters
int$a_tpl_id

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

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and factoryByTypeAndId().

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

{
global $ilDB;
$query = 'SELECT id, type_id FROM didactic_tpl_a '.
'WHERE tpl_id = '.$ilDB->quote($a_tpl_id,'integer');
$res = $ilDB->query($query);
$actions = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$actions[] = self::factoryByTypeAndId($row->id, $row->type_id);
}
return (array) $actions;
}

+ 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: