ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjFileStakeholder.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
6 
12 {
13  protected $owner = 6;
17  protected $database;
18 
23  public function __construct(int $owner = 6)
24  {
25  global $DIC;
26  $this->owner = $owner;
27  $this->database = $DIC->database();
28  }
29 
33  public function getId() : string
34  {
35  return 'file_obj';
36  }
37 
38  public function getOwnerOfNewResources() : int
39  {
40  return $this->owner;
41  }
42 
43  public function resourceHasBeenDeleted(ResourceIdentification $identification) : bool
44  {
45  $r = $this->database->queryF("SELECT file_id FROM file_data WHERE rid = %s", ['text'],
46  [$identification->serialize()]);
47  $d = $this->database->fetchObject($r);
48  if (isset($d->file_id)) {
49  try {
50  $this->database->manipulateF("UPDATE object_data SET offline = 1 WHERE obj_id = %s", ['text'],
51  [$d->file_id]);
52  } catch (Throwable $t) {
53  return false;
54  }
55  return true;
56  }
57  return false;
58  }
59 
60 }
Class ilObjFileStakeholder.
resourceHasBeenDeleted(ResourceIdentification $identification)
global $DIC
Definition: goto.php:24
__construct(int $owner=6)
ilObjFileStakeholder constructor.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296