ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilWebDAVMountInstructionsRepositoryImpl Class Reference
+ Inheritance diagram for ilWebDAVMountInstructionsRepositoryImpl:
+ Collaboration diagram for ilWebDAVMountInstructionsRepositoryImpl:

Public Member Functions

 __construct (protected ilDBInterface $db)
 
 createMountInstructionsDocumentEntry (ilWebDAVMountInstructionsDocument $document)
 
 getNextMountInstructionsDocumentId ()
 
 getHighestSortingNumber ()
 
 getMountInstructionsDocumentById (int $id)
 
 getMountInstructionsByLanguage (string $language)
 
 getAllMountInstructions ()
 
 doMountInstructionsExistByLanguage (string $language)
 
 updateMountInstructions (ilWebDAVMountInstructionsDocument $document)
 
 updateSortingValueById (int $id, int $a_new_sorting_value)
 
 deleteMountInstructionsById (int $id)
 
 createMountInstructionsDocumentEntry (ilWebDAVMountInstructionsDocument $document)
 
 getNextMountInstructionsDocumentId ()
 
 getHighestSortingNumber ()
 
 getMountInstructionsDocumentById (int $id)
 
 getMountInstructionsByLanguage (string $language)
 
 getAllMountInstructions ()
 
 doMountInstructionsExistByLanguage (string $language)
 
 updateMountInstructions (ilWebDAVMountInstructionsDocument $document)
 
 updateSortingValueById (int $id, int $a_new_sorting_value)
 
 deleteMountInstructionsById (int $id)
 

Data Fields

const TABLE_MOUNT_INSTRUCTIONS = 'webdav_instructions'
 

Protected Member Functions

 buildDocumentFromDatabaseRecord (array $result)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVMountInstructionsRepositoryImpl::__construct ( protected ilDBInterface  $db)

Definition at line 25 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

26 {
27 }

Member Function Documentation

◆ buildDocumentFromDatabaseRecord()

ilWebDAVMountInstructionsRepositoryImpl::buildDocumentFromDatabaseRecord ( array  $result)
protected

Definition at line 173 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

174 {
176 (int) $result['id'],
177 $result['title'],
178 $result['uploaded_instructions'],
179 $result['processed_instructions'],
180 $result['lng'],
181 $result['creation_ts'],
182 $result['modification_ts'],
183 (int) $result['owner_usr_id'],
184 (int) $result['last_modification_usr_id'],
185 (int) $result['sorting']
186 );
187 }

Referenced by getAllMountInstructions(), getMountInstructionsByLanguage(), and getMountInstructionsDocumentById().

+ Here is the caller graph for this function:

◆ createMountInstructionsDocumentEntry()

ilWebDAVMountInstructionsRepositoryImpl::createMountInstructionsDocumentEntry ( ilWebDAVMountInstructionsDocument  $document)

Implements ilWebDAVMountInstructionsRepository.

Definition at line 29 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

29 : void
30 {
31 $this->db->insert(
32 // table
33 self::TABLE_MOUNT_INSTRUCTIONS,
34
35 // values
36 [
37 'id' => ['int', $document->getId()],
38 'title' => ['text', $document->getTitle()],
39 'uploaded_instructions' => ['clob', $document->getUploadedInstructions()],
40 'processed_instructions' => ['clob', $document->getProcessedInstructions()],
41 'lng' => ['text', $document->getLanguage()],
42 'creation_ts' => ['timestamp', $document->getCreationTs()],
43 'modification_ts' => ['timestamp', $document->getModificationTs()],
44 'owner_usr_id' => ['int', $document->getOwnerUsrId()],
45 'last_modification_usr_id' => ['int', $document->getLastModificationUsrId()],
46 'sorting' => ['int', $document->getSorting()]
47 ]
48 );
49 }

References ilWebDAVMountInstructionsDocument\getCreationTs(), ilWebDAVMountInstructionsDocument\getId(), ilWebDAVMountInstructionsDocument\getLanguage(), ilWebDAVMountInstructionsDocument\getLastModificationUsrId(), ilWebDAVMountInstructionsDocument\getModificationTs(), ilWebDAVMountInstructionsDocument\getOwnerUsrId(), ilWebDAVMountInstructionsDocument\getProcessedInstructions(), ilWebDAVMountInstructionsDocument\getSorting(), ilWebDAVMountInstructionsDocument\getTitle(), and ilWebDAVMountInstructionsDocument\getUploadedInstructions().

+ Here is the call graph for this function:

◆ deleteMountInstructionsById()

ilWebDAVMountInstructionsRepositoryImpl::deleteMountInstructionsById ( int  $id)

Implements ilWebDAVMountInstructionsRepository.

Definition at line 165 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

165 : void
166 {
167 $query = "DELETE FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS)
168 . ' WHERE id=' . $this->db->quote($id, 'integer');
169
170 $this->db->manipulate($query);
171 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

◆ doMountInstructionsExistByLanguage()

ilWebDAVMountInstructionsRepositoryImpl::doMountInstructionsExistByLanguage ( string  $language)

Implements ilWebDAVMountInstructionsRepository.

Definition at line 112 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

112 : int
113 {
114 $query = "SELECT id FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS)
115 . " WHERE lng=" . $this->db->quote($language, 'text');
116
117 $result = $this->db->query($query);
118 $record = $this->db->fetchAssoc($result);
119
120 return ($record === null ? 0 : (int) $record['id']);
121 }

◆ getAllMountInstructions()

ilWebDAVMountInstructionsRepositoryImpl::getAllMountInstructions ( )

Implements ilWebDAVMountInstructionsRepository.

Definition at line 99 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

99 : array
100 {
101 $query = "SELECT * FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS) . " ORDER BY sorting";
102 $result = $this->db->query($query);
103
104 $document_list = [];
105 while ($record = $this->db->fetchAssoc($result)) {
106 $document_list[] = $this->buildDocumentFromDatabaseRecord($record);
107 }
108
109 return $document_list;
110 }

References buildDocumentFromDatabaseRecord().

+ Here is the call graph for this function:

◆ getHighestSortingNumber()

ilWebDAVMountInstructionsRepositoryImpl::getHighestSortingNumber ( )

Implements ilWebDAVMountInstructionsRepository.

Definition at line 60 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

60 : int
61 {
62 $query = "SELECT max(sorting) as max_sort FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS);
63 $result = $this->db->query($query);
64
65 $row = $this->db->fetchAssoc($result);
66 return isset($row) && !is_null($row['max_sort']) ? (int) $row['max_sort'] : 0;
67 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getMountInstructionsByLanguage()

ilWebDAVMountInstructionsRepositoryImpl::getMountInstructionsByLanguage ( string  $language)

Implements ilWebDAVMountInstructionsRepository.

Definition at line 84 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

85 {
86 $query = "SELECT * FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS)
87 . " WHERE lng=" . $this->db->quote($language, 'text');
88
89 $result = $this->db->query($query);
90 $record = $this->db->fetchAssoc($result);
91
92 if (!$record) {
93 throw new InvalidArgumentException("Document for the language $language not found");
94 }
95
96 return $this->buildDocumentFromDatabaseRecord($record);
97 }

References buildDocumentFromDatabaseRecord().

+ Here is the call graph for this function:

◆ getMountInstructionsDocumentById()

ilWebDAVMountInstructionsRepositoryImpl::getMountInstructionsDocumentById ( int  $id)

Implements ilWebDAVMountInstructionsRepository.

Definition at line 69 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

70 {
71 $query = "SELECT * FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS)
72 . " WHERE id=" . $this->db->quote($id, 'int');
73
74 $result = $this->db->query($query);
75 $record = $this->db->fetchAssoc($result);
76
77 if (!$record) {
78 throw new InvalidArgumentException("Document with the id $id not found");
79 }
80
81 return $this->buildDocumentFromDatabaseRecord($record);
82 }

References $id, and buildDocumentFromDatabaseRecord().

+ Here is the call graph for this function:

◆ getNextMountInstructionsDocumentId()

ilWebDAVMountInstructionsRepositoryImpl::getNextMountInstructionsDocumentId ( )

Implements ilWebDAVMountInstructionsRepository.

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

51 : int
52 {
53 if (!$this->db->sequenceExists(self::TABLE_MOUNT_INSTRUCTIONS)) {
54 $this->db->createSequence(self::TABLE_MOUNT_INSTRUCTIONS);
55 }
56
57 return $this->db->nextId(self::TABLE_MOUNT_INSTRUCTIONS);
58 }

◆ updateMountInstructions()

ilWebDAVMountInstructionsRepositoryImpl::updateMountInstructions ( ilWebDAVMountInstructionsDocument  $document)

Implements ilWebDAVMountInstructionsRepository.

Definition at line 123 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

123 : void
124 {
125 $this->db->update(
126 // table name
127 self::TABLE_MOUNT_INSTRUCTIONS,
128
129 // values to update
130 [
131 'title' => ['text', $document->getTitle()],
132 'lng' => ['text', $document->getLanguage()],
133 'creation_ts' => ['timestamp', $document->getCreationTs()],
134 'modification_ts' => ['timestamp', $document->getModificationTs()],
135 'owner_usr_id' => ['int', $document->getOwnerUsrId()],
136 'last_modification_usr_id' => ['int', $document->getLastModificationUsrId()],
137 'sorting' => ['int', $document->getSorting()]
138 ],
139
140 // which rows to update
141 [
142 'id' => ['int', $document->getId()],
143 ]
144 );
145 }

References ilWebDAVMountInstructionsDocument\getCreationTs(), ilWebDAVMountInstructionsDocument\getId(), ilWebDAVMountInstructionsDocument\getLanguage(), ilWebDAVMountInstructionsDocument\getLastModificationUsrId(), ilWebDAVMountInstructionsDocument\getModificationTs(), ilWebDAVMountInstructionsDocument\getOwnerUsrId(), ilWebDAVMountInstructionsDocument\getSorting(), and ilWebDAVMountInstructionsDocument\getTitle().

+ Here is the call graph for this function:

◆ updateSortingValueById()

ilWebDAVMountInstructionsRepositoryImpl::updateSortingValueById ( int  $id,
int  $a_new_sorting_value 
)

Implements ilWebDAVMountInstructionsRepository.

Definition at line 147 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

147 : void
148 {
149 $this->db->update(
150 // table name
151 self::TABLE_MOUNT_INSTRUCTIONS,
152
153 // values to update
154 [
155 'sorting' => ['int', $a_new_sorting_value]
156 ],
157
158 // which rows to update
159 [
160 'id' => ['int', $id],
161 ]
162 );
163 }

References $id.

Field Documentation

◆ TABLE_MOUNT_INSTRUCTIONS

const ilWebDAVMountInstructionsRepositoryImpl::TABLE_MOUNT_INSTRUCTIONS = 'webdav_instructions'

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