mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +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;
|
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
|
* Returns the parent
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user