Remove now unused methods in Share.php due to the reduced code complexity in Share::getItems

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2020-11-29 22:38:19 +01:00
parent 10e5ae5e18
commit 6564a95160
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 0 additions and 36 deletions

View File

@ -291,42 +291,6 @@ class Share extends Constants {
return false;
}
/**
* Checks whether a share has expired, calls unshareItem() if yes.
* @param array $item Share data (usually database row)
* @return boolean True if item was expired, false otherwise.
*/
protected static function expireItem(array $item) {
$result = false;
// only use default expiration date for link shares
if ((int) $item['share_type'] === IShare::TYPE_LINK) {
// calculate expiration date
if (!empty($item['expiration'])) {
$userDefinedExpire = new \DateTime($item['expiration']);
$expires = $userDefinedExpire->getTimestamp();
} else {
$expires = null;
}
// get default expiration settings
$defaultSettings = Helper::getDefaultExpireSetting();
$expires = Helper::calculateExpireDate($defaultSettings, $item['stime'], $expires);
if (is_int($expires)) {
$now = time();
if ($now > $expires) {
self::unshareItem($item);
$result = true;
}
}
}
return $result;
}
/**
* Unshares a share given a share data array
* @param array $item Share data (usually database row)