ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjectDataDeletionLog.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
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}
Class ilObject Basic functions for all objects.
getLongDescription()
get object long description (stored in object_description)
global $DIC
Definition: shib_login.php:26