ILIAS  release_7 Revision v7.30-3-g800a261c036
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

 $owner = 6
 
 $database
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjFileStakeholder::__construct ( int  $owner = 6)

ilObjFileStakeholder constructor.

Parameters
int$owner

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

References $DIC, and $owner.

24  {
25  global $DIC;
26  $this->owner = $owner;
27  $this->database = $DIC->database();
28  }
global $DIC
Definition: goto.php:24

Member Function Documentation

◆ getId()

ilObjFileStakeholder::getId ( )

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

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

33  : string
34  {
35  return 'file_obj';
36  }

◆ getOwnerOfNewResources()

ilObjFileStakeholder::getOwnerOfNewResources ( )
Returns
int

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

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

References $owner.

38  : int
39  {
40  return $this->owner;
41  }

◆ resourceHasBeenDeleted()

ilObjFileStakeholder::resourceHasBeenDeleted ( ResourceIdentification  $identification)
Parameters
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 43 of file class.ilObjFileStakeholder.php.

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

43  : 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  }
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

ilObjFileStakeholder::$database
protected

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

◆ $owner

ilObjFileStakeholder::$owner = 6
protected

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

Referenced by __construct(), and getOwnerOfNewResources().


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