diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 3762dec6c..1aba718e6 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -303,6 +303,26 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ return $this->_date; } /* }}} */ + /** + * Set creation date of the document + * + * @param integer $date timestamp of creation date. If false then set it + * to the current timestamp + * @return boolean true on success + */ + function setDate($date) { /* {{{ */ + $db = $this->_dms->getDB(); + + if(!$date) + $date = time(); + + $queryStr = "UPDATE tblDocuments SET date = " . $date . " WHERE id = ". $this->_id; + if (!$db->getResult($queryStr)) + return false; + $this->_date = $date; + return true; + } /* }}} */ + /** * Return the parent folder of the document *