add docs for hasExpired(), doc expires with the first second of the next

This commit is contained in:
Uwe Steinmann 2020-05-27 12:01:40 +02:00
parent f737b20830
commit a4b84f5558

View File

@ -790,11 +790,16 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
/**
* Check if the document has expired
*
* The method expects to database field 'expired' to hold the timestamp
* of the start of day at which end the document expires. The document will
* expire if that day is over. Hence, a document will *not*
* be expired during the day of expiration but at the end of that day
*
* @return boolean true if document has expired otherwise false
*/
function hasExpired() { /* {{{ */
if (intval($this->_expires) == 0) return false;
if (time()>$this->_expires+24*60*60) return true;
if (time()>=$this->_expires+24*60*60) return true;
return false;
} /* }}} */