new method setMimeType()

This commit is contained in:
Uwe Steinmann 2021-10-02 07:29:15 +02:00
parent fbf86b0fe6
commit 0163159c84

View File

@ -3163,10 +3163,27 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return true;
} /* }}} */
function setMimeType($newMimetype) { /* {{{ */
$db = $this->_document->getDMS()->getDB();
$newMimetype = trim($newMimetype);
if(!$newMimetype)
return false;
$queryStr = "UPDATE `tblDocumentContent` SET `mimeType` = ".$db->qstr($newMimetype)." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
if (!$db->getResult($queryStr))
return false;
$this->_mimeType = $newMimetype;
return true;
} /* }}} */
function setComment($newComment) { /* {{{ */
$db = $this->_document->getDMS()->getDB();
$queryStr = "UPDATE `tblDocumentContent` SET `comment` = ".$db->qstr($newComment)." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
$queryStr = "UPDATE `tblDocumentContent` SET `comment` = ".$db->qstr($newComment)." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
if (!$db->getResult($queryStr))
return false;