aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/expiration.php
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2015-08-11 22:21:32 +0300
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2015-09-16 17:37:21 +0300
commit8ac3d5e36c7d628f1ba4d27c68d54786eed972b2 (patch)
treed6037ab97eff31a02ede7697074ff853cc258a9e /apps/files_trashbin/lib/expiration.php
parenta1e343ae7ce69fd8dd39e4d58e172c00d1992cbd (diff)
downloadnextcloud-server-8ac3d5e36c7d628f1ba4d27c68d54786eed972b2.tar.gz
nextcloud-server-8ac3d5e36c7d628f1ba4d27c68d54786eed972b2.zip
Add expiration cronjob
Diffstat (limited to 'apps/files_trashbin/lib/expiration.php')
-rw-r--r--apps/files_trashbin/lib/expiration.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/expiration.php b/apps/files_trashbin/lib/expiration.php
index 138540febf8..c8a6abb627b 100644
--- a/apps/files_trashbin/lib/expiration.php
+++ b/apps/files_trashbin/lib/expiration.php
@@ -105,6 +105,15 @@ class Expiration {
return $isOlderThanMax || $isMinReached;
}
+ public function getMaxAgeAsTimestamp(){
+ $maxAge = false;
+ if ($this->isEnabled() && $this->maxAge !== self::NO_OBLIGATION) {
+ $time = $this->timeFactory->getTime();
+ $maxAge = $time - ($this->maxAge * 86400);
+ }
+ return $maxAge;
+ }
+
private function parseRetentionObligation(){
$splitValues = explode(',', $this->retentionObligation);
if (!isset($splitValues[0])) {