ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDidacticTemplateObjSettings Class Reference

Stores the applied template id for objects. More...

+ Collaboration diagram for ilDidacticTemplateObjSettings:

Static Public Member Functions

static lookupTemplateId ($a_ref_id)
 Lookup template id ilDB $ilDB.
static deleteByObjId ($a_obj_id)
 Delete by obj id ilDB $ilDB.
static deleteByTemplateId ($a_tpl_id)
 Delete by template id ilDB $ilDB.
static deleteByRefId ($a_ref_id)
 Delete by ref_id ilDB $ilDB.
static assignTemplate ($a_ref_id, $a_obj_id, $a_tpl_id)
 Assign template to object ilDB $ilDB.

Detailed Description

Stores the applied template id for objects.

Author
Stefan Meyer <meyer.de>

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

Member Function Documentation

static ilDidacticTemplateObjSettings::assignTemplate (   $a_ref_id,
  $a_obj_id,
  $a_tpl_id 
)
static

Assign template to object ilDB $ilDB.

Parameters
int$a_obj_id
int$a_tpl_id
Returns
bool

Definition at line 87 of file class.ilDidacticTemplateObjSettings.php.

References $query, and deleteByRefId().

Referenced by ilObject\applyDidacticTemplate(), and ilDidacticTemplateGUI\switchTemplate().

{
global $ilDB;
self::deleteByRefId($a_ref_id);
$query = 'INSERT INTO didactic_tpl_objs (ref_id,obj_id,tpl_id) '.
'VALUES ( '.
$ilDB->quote($a_ref_id,'integer').', '.
$ilDB->quote($a_obj_id,'integer').', '.
$ilDB->quote($a_tpl_id,'integer').' '.
')';
$ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilDidacticTemplateObjSettings::deleteByObjId (   $a_obj_id)
static

Delete by obj id ilDB $ilDB.

Parameters
int$a_obj_id
Returns
bool

Definition at line 40 of file class.ilDidacticTemplateObjSettings.php.

References $query.

Referenced by ilObject\delete().

{
global $ilDB;
$query = 'DELETE FROM didactic_tpl_objs '.
'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer');
$ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilDidacticTemplateObjSettings::deleteByRefId (   $a_ref_id)
static

Delete by ref_id ilDB $ilDB.

Parameters
int$a_ref_id

Definition at line 71 of file class.ilDidacticTemplateObjSettings.php.

References $query.

Referenced by assignTemplate(), and ilObject\delete().

{
global $ilDB;
$query = 'DELETE FROM didactic_tpl_objs '.
'WHERE ref_id = '.$ilDB->quote($a_ref_id,'integer');
$ilDB->manipulate($query);
}

+ Here is the caller graph for this function:

static ilDidacticTemplateObjSettings::deleteByTemplateId (   $a_tpl_id)
static

Delete by template id ilDB $ilDB.

Parameters
int$a_tpl_id
Returns
bool

Definition at line 56 of file class.ilDidacticTemplateObjSettings.php.

References $query.

{
global $ilDB;
$query = 'DELETE FROM didactic_tpl_objs '.
'WHERE tpl_id = '.$ilDB->quote($a_tpl_id,'integer');
$ilDB->manipulate($query);
return true;
}
static ilDidacticTemplateObjSettings::lookupTemplateId (   $a_ref_id)
static

Lookup template id ilDB $ilDB.

Parameters
int$a_ref_id
Returns
int

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

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilContainerGUI\afterUpdate(), ilDidacticTemplateGUI\appendToolbarSwitch(), ilObject\cloneDependencies(), ilDidacticTemplateGUI\confirmTemplateSwitch(), ilObjectGUI\initDidacticTemplate(), and ilDidacticTemplateGUI\switchTemplate().

{
global $ilDB;
$query = 'SELECT tpl_id FROM didactic_tpl_objs '.
'WHERE ref_id = '.$ilDB->quote($a_ref_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->tpl_id;
}
return 0;
}

+ Here is the caller graph for this function:


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