ILIAS  release_8 Revision v8.24
ilWebDAVMountInstructionsRepositoryImpl Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilWebDAVMountInstructionsRepositoryImpl:
+ Collaboration diagram for ilWebDAVMountInstructionsRepositoryImpl:

Public Member Functions

 __construct (ilDBInterface $a_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)
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVMountInstructionsRepositoryImpl::__construct ( ilDBInterface  $a_db)

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

29 {
30 $this->db = $a_db;
31 }

Member Function Documentation

◆ buildDocumentFromDatabaseRecord()

ilWebDAVMountInstructionsRepositoryImpl::buildDocumentFromDatabaseRecord ( array  $result)
protected

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

178 {
180 (int) $result['id'],
181 $result['title'],
182 $result['uploaded_instructions'],
183 $result['processed_instructions'],
184 $result['lng'],
185 $result['creation_ts'],
186 $result['modification_ts'],
187 (int) $result['owner_usr_id'],
188 (int) $result['last_modification_usr_id'],
189 (int) $result['sorting']
190 );
191 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the caller graph for this function:

◆ createMountInstructionsDocumentEntry()

ilWebDAVMountInstructionsRepositoryImpl::createMountInstructionsDocumentEntry ( ilWebDAVMountInstructionsDocument  $document)

Implements ilWebDAVMountInstructionsRepository.

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

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

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 169 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

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

References $id, and $query.

◆ doMountInstructionsExistByLanguage()

ilWebDAVMountInstructionsRepositoryImpl::doMountInstructionsExistByLanguage ( string  $language)

Implements ilWebDAVMountInstructionsRepository.

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

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

References $query.

◆ getAllMountInstructions()

ilWebDAVMountInstructionsRepositoryImpl::getAllMountInstructions ( )

Implements ilWebDAVMountInstructionsRepository.

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

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

References $query, and buildDocumentFromDatabaseRecord().

+ Here is the call graph for this function:

◆ getHighestSortingNumber()

ilWebDAVMountInstructionsRepositoryImpl::getHighestSortingNumber ( )

Implements ilWebDAVMountInstructionsRepository.

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

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

References $query, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getMountInstructionsByLanguage()

ilWebDAVMountInstructionsRepositoryImpl::getMountInstructionsByLanguage ( string  $language)

Implements ilWebDAVMountInstructionsRepository.

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

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

References $query, and buildDocumentFromDatabaseRecord().

+ Here is the call graph for this function:

◆ getMountInstructionsDocumentById()

ilWebDAVMountInstructionsRepositoryImpl::getMountInstructionsDocumentById ( int  $id)

Implements ilWebDAVMountInstructionsRepository.

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

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

References $id, $query, and buildDocumentFromDatabaseRecord().

+ Here is the call graph for this function:

◆ getNextMountInstructionsDocumentId()

ilWebDAVMountInstructionsRepositoryImpl::getNextMountInstructionsDocumentId ( )

Implements ilWebDAVMountInstructionsRepository.

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

55 : int
56 {
57 if (!$this->db->sequenceExists(self::TABLE_MOUNT_INSTRUCTIONS)) {
58 $this->db->createSequence(self::TABLE_MOUNT_INSTRUCTIONS);
59 }
60
61 return $this->db->nextId(self::TABLE_MOUNT_INSTRUCTIONS);
62 }

◆ updateMountInstructions()

ilWebDAVMountInstructionsRepositoryImpl::updateMountInstructions ( ilWebDAVMountInstructionsDocument  $document)

Implements ilWebDAVMountInstructionsRepository.

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

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

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 151 of file class.ilWebDAVMountInstructionsRepositoryImpl.php.

151 : void
152 {
153 $this->db->update(
154 // table name
155 self::TABLE_MOUNT_INSTRUCTIONS,
156
157 // values to update
158 array(
159 'sorting' => array('int', $a_new_sorting_value)
160 ),
161
162 // which rows to update
163 array(
164 'id' => array('int', $id),
165 )
166 );
167 }

References $id.

Field Documentation

◆ $db

ilDBInterface ilWebDAVMountInstructionsRepositoryImpl::$db
protected

◆ TABLE_MOUNT_INSTRUCTIONS

const ilWebDAVMountInstructionsRepositoryImpl::TABLE_MOUNT_INSTRUCTIONS = 'webdav_instructions'

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