diff options
Diffstat (limited to 'apps/files_versions/lib/Expiration.php')
-rw-r--r-- | apps/files_versions/lib/Expiration.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/files_versions/lib/Expiration.php b/apps/files_versions/lib/Expiration.php index b84756212e4..1e04d93379f 100644 --- a/apps/files_versions/lib/Expiration.php +++ b/apps/files_versions/lib/Expiration.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -99,6 +100,20 @@ class Expiration { } /** + * Get minimal retention obligation as a timestamp + * + * @return int|false + */ + public function getMinAgeAsTimestamp() { + $minAge = false; + if ($this->isEnabled() && $this->minAge !== self::NO_OBLIGATION) { + $time = $this->timeFactory->getTime(); + $minAge = $time - ($this->minAge * 86400); + } + return $minAge; + } + + /** * Get maximal retention obligation as a timestamp * * @return int|false |