ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjFileStakeholder Class Reference

Class ilObjFileStakeholder. More...

+ Inheritance diagram for ilObjFileStakeholder:
+ Collaboration diagram for ilObjFileStakeholder:

Public Member Functions

 __construct (int $owner=6)
 ilObjFileStakeholder constructor. More...
 
 getId ()
 
 getOwnerOfNewResources ()
 
 resourceHasBeenDeleted (ResourceIdentification $identification)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder
 getFullyQualifiedClassName ()
 
 isResourceInUse (ResourceIdentification $identification)
 
 resourceHasBeenDeleted (ResourceIdentification $identification)
 
 getOwnerOfResource (ResourceIdentification $identification)
 
 getConsumerNameForPresentation ()
 

Protected Attributes

int $owner = 6
 
ilDBInterface $database
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjFileStakeholder::__construct ( int  $owner = 6)

ilObjFileStakeholder constructor.

Definition at line 33 of file class.ilObjFileStakeholder.php.

References $owner.

34  {
35  $this->owner = $owner;
36  }

Member Function Documentation

◆ getId()

ilObjFileStakeholder::getId ( )

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 41 of file class.ilObjFileStakeholder.php.

41  : string
42  {
43  return 'file_obj';
44  }

◆ getOwnerOfNewResources()

ilObjFileStakeholder::getOwnerOfNewResources ( )

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 46 of file class.ilObjFileStakeholder.php.

References $owner.

46  : int
47  {
48  return $this->owner;
49  }

◆ resourceHasBeenDeleted()

ilObjFileStakeholder::resourceHasBeenDeleted ( ResourceIdentification  $identification)
Returns
bool true: if the Stakeholder could handle the deletion; false: if the Stakeholder could not handle the deletion of the resource.

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 51 of file class.ilObjFileStakeholder.php.

References $d, $DIC, and ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().

51  : bool
52  {
53  global $DIC;
54  $this->database = $DIC->database();
55  $r = $this->database->queryF(
56  "SELECT file_id FROM file_data WHERE rid = %s",
57  ['text'],
58  [$identification->serialize()]
59  );
60  $d = $this->database->fetchObject($r);
61  if (isset($d->file_id)) {
62  try {
63  $this->database->manipulateF(
64  "UPDATE object_data SET offline = 1 WHERE obj_id = %s",
65  ['text'],
66  [$d->file_id]
67  );
68  } catch (Throwable $t) {
69  return false;
70  }
71  return true;
72  }
73  return false;
74  }
global $DIC
Definition: feed.php:28
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

Field Documentation

◆ $database

ilDBInterface ilObjFileStakeholder::$database
protected

Definition at line 28 of file class.ilObjFileStakeholder.php.

◆ $owner

int ilObjFileStakeholder::$owner = 6
protected

Definition at line 27 of file class.ilObjFileStakeholder.php.

Referenced by __construct(), and getOwnerOfNewResources().


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