mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
add SeedDMS_Core_Document::setDate()
This commit is contained in:
parent
f9b75e5071
commit
53bac225fb
|
@ -303,6 +303,26 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return $this->_date;
|
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
|
* Return the parent folder of the document
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user