ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\MediaObjects\MediaObjectRepository Class Reference
+ Collaboration diagram for ILIAS\MediaObjects\MediaObjectRepository:

Public Member Functions

 __construct (protected ilDBInterface $db, protected IRSSWrapper $irss)
 
 create (int $id, string $title, \ilMobStakeholder $stakeholder, int $from_mob_id=0)
 
 getById (int $id)
 
 delete (int $id)
 
 addFileFromLegacyUpload (int $mob_id, string $tmp_name, string $target_path="")
 
 addFileFromUpload (int $mob_id, UploadResult $result, string $path="/")
 
 addFileFromLocal (int $mob_id, string $tmp_name, string $path)
 
 addLocalDirectory (int $mob_id, string $dir)
 
 getLocalSrc (int $mob_id, string $location)
 
 hasLocalFile (int $mob_id, string $location)
 
 getLocationStream (int $mob_id, string $location)
 
 getInfoOfEntry (int $mob_id, string $path)
 
 deliverEntry (int $mob_id, string $path)
 
 getContainerPath (int $mob_id)
 
 addStream (int $mob_id, string $location, FileStream $stream)
 
 addString (int $mob_id, string $location, string $content)
 
 getContainerResource (int $mob_id)
 
 getContainerResourceId (int $mob_id)
 
 removeLocation (int $mob_id, string $location)
 
 getFilesOfPath (int $mob_id, string $dir_path)
 

Protected Member Functions

 getRidForMobId (int $mob_id)
 

Detailed Description

Definition at line 31 of file MediaObjectRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MediaObjects\MediaObjectRepository::__construct ( protected ilDBInterface  $db,
protected IRSSWrapper  $irss 
)

Definition at line 33 of file MediaObjectRepository.php.

36  {
37  }

Member Function Documentation

◆ addFileFromLegacyUpload()

ILIAS\MediaObjects\MediaObjectRepository::addFileFromLegacyUpload ( int  $mob_id,
string  $tmp_name,
string  $target_path = "" 
)

Definition at line 102 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

102  : void
103  {
104  if ($rid = $this->getRidForMobId($mob_id)) {
105  if ($target_path === "") {
106  $target_path = "/";
107  }
108  $this->irss->importFileFromLegacyUploadToContainer(
109  $rid,
110  $tmp_name,
111  $target_path
112  );
113  }
114  }
+ Here is the call graph for this function:

◆ addFileFromLocal()

ILIAS\MediaObjects\MediaObjectRepository::addFileFromLocal ( int  $mob_id,
string  $tmp_name,
string  $path 
)

Definition at line 130 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

130  : void
131  {
132  if ($rid = $this->getRidForMobId($mob_id)) {
133  $this->irss->addLocalFileToContainer(
134  $rid,
135  $tmp_name,
136  $path
137  );
138  }
139  }
$path
Definition: ltiservices.php:30
+ Here is the call graph for this function:

◆ addFileFromUpload()

ILIAS\MediaObjects\MediaObjectRepository::addFileFromUpload ( int  $mob_id,
UploadResult  $result,
string  $path = "/" 
)

Definition at line 116 of file MediaObjectRepository.php.

References $path, and ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

120  : void {
121  if ($rid = $this->getRidForMobId($mob_id)) {
122  $this->irss->importFileFromUploadResultToContainer(
123  $rid,
124  $result,
125  $path
126  );
127  }
128  }
$path
Definition: ltiservices.php:30
+ Here is the call graph for this function:

◆ addLocalDirectory()

ILIAS\MediaObjects\MediaObjectRepository::addLocalDirectory ( int  $mob_id,
string  $dir 
)

Definition at line 141 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

141  : void
142  {
143  if ($rid = $this->getRidForMobId($mob_id)) {
144  $this->irss->addDirectoryToContainer(
145  $rid,
146  $dir
147  );
148  }
149  }
+ Here is the call graph for this function:

◆ addStream()

ILIAS\MediaObjects\MediaObjectRepository::addStream ( int  $mob_id,
string  $location,
FileStream  $stream 
)

Definition at line 199 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

203  : void {
204  $this->irss->addStreamToContainer(
205  $this->getRidForMobId($mob_id),
206  $stream,
207  $location
208  );
209  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
+ Here is the call graph for this function:

◆ addString()

ILIAS\MediaObjects\MediaObjectRepository::addString ( int  $mob_id,
string  $location,
string  $content 
)

Definition at line 211 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

215  : void {
216  $this->irss->addStringToContainer(
217  $this->getRidForMobId($mob_id),
218  $content,
219  $location
220  );
221  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
+ Here is the call graph for this function:

◆ create()

ILIAS\MediaObjects\MediaObjectRepository::create ( int  $id,
string  $title,
\ilMobStakeholder  $stakeholder,
int  $from_mob_id = 0 
)

Definition at line 39 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

44  : void {
45  if ($from_mob_id > 0) {
46  $from_rid = $this->getRidForMobId($from_mob_id);
47  $rid = $this->irss->cloneContainer($from_rid);
48  } else {
49  $rid = $this->irss->createContainer(
50  $stakeholder,
51  "mob.zip"
52  );
53  }
54  $this->db->insert('mob_data', [
55  'id' => ['integer', $id],
56  'rid' => ['text', $rid]
57  ]);
58  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:

◆ delete()

ILIAS\MediaObjects\MediaObjectRepository::delete ( int  $id)

Definition at line 79 of file MediaObjectRepository.php.

References $id.

79  : void
80  {
81  $this->db->manipulateF(
82  'DELETE FROM mob_data WHERE id = %s',
83  ['integer'],
84  [$id]
85  );
86  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24

◆ deliverEntry()

ILIAS\MediaObjects\MediaObjectRepository::deliverEntry ( int  $mob_id,
string  $path 
)

Definition at line 182 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

185  : void
186  {
187  $this->irss->deliverContainerEntry(
188  $this->getRidForMobId($mob_id),
189  $path
190  );
191  }
$path
Definition: ltiservices.php:30
+ Here is the call graph for this function:

◆ getById()

ILIAS\MediaObjects\MediaObjectRepository::getById ( int  $id)

Definition at line 60 of file MediaObjectRepository.php.

References ILIAS\Repository\int().

60  : ?array
61  {
62  $set = $this->db->queryF(
63  'SELECT * FROM mob_data WHERE id = %s',
64  ['integer'],
65  [$id]
66  );
67 
68  $record = $this->db->fetchAssoc($set);
69  if ($record) {
70  return [
71  'id' => (int) $record['id'],
72  'rid' => (string) $record['rid']
73  ];
74  }
75 
76  return null;
77  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:

◆ getContainerPath()

ILIAS\MediaObjects\MediaObjectRepository::getContainerPath ( int  $mob_id)

Definition at line 193 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

195  : string {
196  return $this->irss->getResourcePath($this->getRidForMobId($mob_id));
197  }
+ Here is the call graph for this function:

◆ getContainerResource()

ILIAS\MediaObjects\MediaObjectRepository::getContainerResource ( int  $mob_id)

Definition at line 223 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

225  : ?StorableResource {
226  return $this->irss->getResource($this->getRidForMobId($mob_id));
227  }
+ Here is the call graph for this function:

◆ getContainerResourceId()

ILIAS\MediaObjects\MediaObjectRepository::getContainerResourceId ( int  $mob_id)

Definition at line 229 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

231  : ?ResourceIdentification {
232  return $this->irss->getResourceIdForIdString($this->getRidForMobId($mob_id));
233  }
+ Here is the call graph for this function:

◆ getFilesOfPath()

ILIAS\MediaObjects\MediaObjectRepository::getFilesOfPath ( int  $mob_id,
string  $dir_path 
)

Definition at line 242 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

245  : array {
246  return $this->irss->getContainerEntriesOfPath(
247  $this->getRidForMobId($mob_id),
248  $dir_path
249  );
250  }
+ Here is the call graph for this function:

◆ getInfoOfEntry()

ILIAS\MediaObjects\MediaObjectRepository::getInfoOfEntry ( int  $mob_id,
string  $path 
)

Definition at line 171 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

175  {
176  return $this->irss->getContainerEntryInfo(
177  $this->getRidForMobId($mob_id),
178  $path
179  );
180  }
$path
Definition: ltiservices.php:30
+ Here is the call graph for this function:

◆ getLocalSrc()

ILIAS\MediaObjects\MediaObjectRepository::getLocalSrc ( int  $mob_id,
string  $location 
)

Definition at line 151 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

151  : string
152  {
153  return $this->irss->getContainerUri($this->getRidForMobId($mob_id), $location);
154  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
+ Here is the call graph for this function:

◆ getLocationStream()

ILIAS\MediaObjects\MediaObjectRepository::getLocationStream ( int  $mob_id,
string  $location 
)

Definition at line 161 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

164  : ZIPStream {
165  return $this->irss->getStreamOfContainerEntry(
166  $this->getRidForMobId($mob_id),
167  $location
168  );
169  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
+ Here is the call graph for this function:

◆ getRidForMobId()

◆ hasLocalFile()

ILIAS\MediaObjects\MediaObjectRepository::hasLocalFile ( int  $mob_id,
string  $location 
)

Definition at line 156 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

156  : bool
157  {
158  return $this->irss->hasContainerEntry($this->getRidForMobId($mob_id), $location);
159  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
+ Here is the call graph for this function:

◆ removeLocation()

ILIAS\MediaObjects\MediaObjectRepository::removeLocation ( int  $mob_id,
string  $location 
)

Definition at line 235 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

238  : void {
239  $this->irss->removePathFromContainer($this->getRidForMobId($mob_id), $location);
240  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
+ Here is the call graph for this function:

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