ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjectDataDeletionLog.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
30 {
31  public static function add(ilObject $object): void
32  {
33  global $DIC;
34  $ilDB = $DIC->database();
35 
36  $values = [
37  "obj_id" => ["integer", $object->getId()],
38  "title" => ["text", $object->getTitle()],
39  "tstamp" => ["integer", time()],
40  "type" => ["text", $object->getType()],
41  "description" => ["clob", $object->getLongDescription()]
42  ];
43 
44  $ilDB->insert("object_data_del", $values);
45  }
46 
47  public static function get(int $a_object_id): ?array
48  {
49  global $DIC;
50  $ilDB = $DIC->database();
51 
52  $sql =
53  "SELECT obj_id, title, tstamp, type, description" . PHP_EOL
54  . "FROM object_data_del" . PHP_EOL
55  . "WHERE obj_id = " . $ilDB->quote($a_object_id, "integer") . PHP_EOL
56  ;
57 
58  $set = $ilDB->query($sql);
59  return $ilDB->fetchAssoc($set);
60  }
61 }
global $DIC
Definition: feed.php:28
getLongDescription()
get object long description (stored in object_description)