From e624ebc198144e3948c6c2d17f4697ad965c5281 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 22 Oct 2024 15:32:37 +1300 Subject: [PATCH] API Update code to reflect changes in silverstripe/cms --- src/File.php | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/File.php b/src/File.php index 04e8da45..1d14ea23 100644 --- a/src/File.php +++ b/src/File.php @@ -31,6 +31,7 @@ use SilverStripe\Security\InheritedPermissionsExtension; use SilverStripe\Security\Member; use SilverStripe\Security\Permission; +use SilverStripe\Security\PermissionCheckable; use SilverStripe\Security\PermissionChecker; use SilverStripe\Security\PermissionProvider; use SilverStripe\Security\Security; @@ -99,7 +100,7 @@ * @method Member Owner() * @method File Parent() */ -class File extends DataObject implements AssetContainer, Thumbnail, CMSPreviewable, PermissionProvider, Resettable +class File extends DataObject implements AssetContainer, Thumbnail, CMSPreviewable, PermissionProvider, Resettable, PermissionCheckable { use ImageManipulation; @@ -351,14 +352,6 @@ public function AbsoluteLink() return $this->getAbsoluteURL(); } - /** - * @return string - */ - public function getTreeTitle() - { - return Convert::raw2xml($this->Title); - } - /** * @param Member $member * @return bool @@ -1435,10 +1428,7 @@ public function PreviewLink($action = null) return $link; } - /** - * @return PermissionChecker - */ - public function getPermissionChecker() + public function getPermissionChecker(): PermissionChecker { return Injector::inst()->get(PermissionChecker::class.'.file'); } @@ -1518,12 +1508,12 @@ protected function filterFilename($name) }, $parts ?? [])); } - public function flushCache($persistent = true) + public function flushCache(bool $persistent = true): static { - parent::flushCache($persistent); static::reset(); ImageShortcodeProvider::flush(); FileShortcodeProvider::flush(); + return parent::flushCache($persistent); } public static function reset()