From a4b84f55588b51c8eb642c8c1e0b502cd179431a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 27 May 2020 12:01:40 +0200 Subject: [PATCH] add docs for hasExpired(), doc expires with the first second of the next --- SeedDMS_Core/Core/inc.ClassDocument.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index fa62635ea..8d264bdb2 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -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; } /* }}} */