mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
add method setDate()
This commit is contained in:
parent
bc1eecc08c
commit
150e5445df
|
@ -133,6 +133,30 @@ class SeedDMS_Core_Folder 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();
|
||||
else {
|
||||
if(!is_numeric($date))
|
||||
return false;
|
||||
}
|
||||
|
||||
$queryStr = "UPDATE tblFolders SET date = " . (int) $date . " WHERE id = ". $this->_id;
|
||||
if (!$db->getResult($queryStr))
|
||||
return false;
|
||||
$this->_date = $date;
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Returns the parent
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user