ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTableTemplatesStorage Class Reference

Saves (mostly asynchronously) user properties of tables (e.g. More...

+ Collaboration diagram for ilTableTemplatesStorage:

Public Member Functions

 store ($a_context, $a_user_id, $a_name, array $a_state)
 Store table template.
 load ($a_context, $a_user_id, $a_name)
 Get table template.
 delete ($a_context, $a_user_id, $a_name)
 Delete table template.
 getNames ($a_context, $a_user_id)
 List templates.

Detailed Description

Saves (mostly asynchronously) user properties of tables (e.g.

filter on/off)

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

ilTableTemplatesStorage:

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

Member Function Documentation

ilTableTemplatesStorage::delete (   $a_context,
  $a_user_id,
  $a_name 
)

Delete table template.

Parameters
string$a_context
int$a_user_id
string$a_name

Definition at line 73 of file class.ilTableTemplatesStorage.php.

References $ilDB.

{
global $ilDB;
if ($a_context == "" || $a_name == "")
{
return;
}
$ilDB->query("DELETE FROM table_templates ".
" WHERE name = ".$ilDB->quote($a_name, "text").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND context = ".$ilDB->quote($a_context, "text")
);
}
ilTableTemplatesStorage::getNames (   $a_context,
  $a_user_id 
)

List templates.

Parameters
string$a_context
int$a_user_id
Returns
array

Definition at line 96 of file class.ilTableTemplatesStorage.php.

References $ilDB.

{
global $ilDB;
if ($a_context == "")
{
return;
}
$set = $ilDB->query("SELECT name FROM table_templates ".
" WHERE user_id = ".$ilDB->quote($a_user_id, "integer").
" AND context = ".$ilDB->quote($a_context, "text").
" ORDER BY name"
);
$result = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$result[] = $rec["name"];
}
return $result;
}
ilTableTemplatesStorage::load (   $a_context,
  $a_user_id,
  $a_name 
)

Get table template.

Parameters
string$a_context
int$a_user_id
string$a_name
Returns
array

Definition at line 48 of file class.ilTableTemplatesStorage.php.

References $ilDB.

{
global $ilDB;
if ($a_context == "" || $a_name == "")
{
return;
}
$set = $ilDB->query("SELECT value FROM table_templates ".
" WHERE name = ".$ilDB->quote($a_name, "text").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND context = ".$ilDB->quote($a_context, "text")
);
$rec = $ilDB->fetchAssoc($set);
return unserialize($rec["value"]);
}
ilTableTemplatesStorage::store (   $a_context,
  $a_user_id,
  $a_name,
array  $a_state 
)

Store table template.

Parameters
string$a_context
int$a_user_id
string$a_name
array$a_state

Definition at line 22 of file class.ilTableTemplatesStorage.php.

References $ilDB.

{
global $ilDB;
if ($a_context == "" || $a_name == "")
{
return;
}
$ilDB->replace("table_templates", array(
"name" => array("text", $a_name),
"user_id" => array("integer", $a_user_id),
"context" => array("text", $a_context)),
array(
"value" => array("text", serialize($a_state))
));
}

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