19declare(strict_types=1);
33 self::TABLE_MOUNT_INSTRUCTIONS,
37 'id' => [
'int', $document->
getId()],
38 'title' => [
'text', $document->
getTitle()],
53 if (!$this->db->sequenceExists(self::TABLE_MOUNT_INSTRUCTIONS)) {
54 $this->db->createSequence(self::TABLE_MOUNT_INSTRUCTIONS);
57 return $this->db->nextId(self::TABLE_MOUNT_INSTRUCTIONS);
62 $query =
"SELECT max(sorting) as max_sort FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS);
63 $result = $this->db->query($query);
65 $row = $this->db->fetchAssoc($result);
66 return isset($row) && !is_null($row[
'max_sort']) ? (
int) $row[
'max_sort'] : 0;
71 $query =
"SELECT * FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS)
72 .
" WHERE id=" . $this->db->quote(
$id,
'int');
74 $result = $this->db->query($query);
75 $record = $this->db->fetchAssoc($result);
78 throw new InvalidArgumentException(
"Document with the id $id not found");
86 $query =
"SELECT * FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS)
87 .
" WHERE lng=" . $this->db->quote($language,
'text');
89 $result = $this->db->query($query);
90 $record = $this->db->fetchAssoc($result);
93 throw new InvalidArgumentException(
"Document for the language $language not found");
101 $query =
"SELECT * FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS) .
" ORDER BY sorting";
102 $result = $this->db->query($query);
105 while ($record = $this->db->fetchAssoc($result)) {
109 return $document_list;
114 $query =
"SELECT id FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS)
115 .
" WHERE lng=" . $this->db->quote($language,
'text');
117 $result = $this->db->query($query);
118 $record = $this->db->fetchAssoc($result);
120 return ($record ===
null ? 0 : (
int) $record[
'id']);
127 self::TABLE_MOUNT_INSTRUCTIONS,
131 'title' => [
'text', $document->
getTitle()],
142 'id' => [
'int', $document->
getId()],
151 self::TABLE_MOUNT_INSTRUCTIONS,
155 'sorting' => [
'int', $a_new_sorting_value]
160 'id' => [
'int',
$id],
167 $query =
"DELETE FROM " . $this->db->quoteIdentifier(self::TABLE_MOUNT_INSTRUCTIONS)
168 .
' WHERE id=' . $this->db->quote(
$id,
'integer');
170 $this->db->manipulate($query);
178 $result[
'uploaded_instructions'],
179 $result[
'processed_instructions'],
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']
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getProcessedInstructions()
getUploadedInstructions()
getLastModificationUsrId()
const TABLE_MOUNT_INSTRUCTIONS
createMountInstructionsDocumentEntry(ilWebDAVMountInstructionsDocument $document)
getNextMountInstructionsDocumentId()
deleteMountInstructionsById(int $id)
buildDocumentFromDatabaseRecord(array $result)
getMountInstructionsByLanguage(string $language)
updateMountInstructions(ilWebDAVMountInstructionsDocument $document)
getMountInstructionsDocumentById(int $id)
doMountInstructionsExistByLanguage(string $language)
getHighestSortingNumber()
updateSortingValueById(int $id, int $a_new_sorting_value)
__construct(protected ilDBInterface $db)
getAllMountInstructions()