ILIAS  trunk Revision v11.0_alpha-1851-ga8564da6fed
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
 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:29
+ 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:29
+ 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 197 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

201  : void {
202  $this->irss->addStreamToContainer(
203  $this->getRidForMobId($mob_id),
204  $stream,
205  $location
206  );
207  }
$location
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:23
+ 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:23

◆ deliverEntry()

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

Definition at line 181 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

184  : void {
185  $this->irss->deliverContainerEntry(
186  $this->getRidForMobId($mob_id),
187  $path
188  );
189  }
$path
Definition: ltiservices.php:29
+ 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(), and null.

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getContainerPath()

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

Definition at line 191 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

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

◆ getContainerResource()

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

Definition at line 209 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

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

◆ getContainerResourceId()

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

Definition at line 215 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

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

◆ getFilesOfPath()

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

Definition at line 228 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

231  : array {
232  return $this->irss->getContainerEntriesOfPath(
233  $this->getRidForMobId($mob_id),
234  $dir_path
235  );
236  }
+ 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().

174  {
175  return $this->irss->getContainerEntryInfo(
176  $this->getRidForMobId($mob_id),
177  $path
178  );
179  }
$path
Definition: ltiservices.php:29
+ 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
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
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
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 221 of file MediaObjectRepository.php.

References ILIAS\MediaObjects\MediaObjectRepository\getRidForMobId().

224  : void {
225  $this->irss->removePathFromContainer($this->getRidForMobId($mob_id), $location);
226  }
$location
Definition: buildRTE.php:22
+ Here is the call graph for this function:

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