Skip to content

Commit

Permalink
API Update code to reflect changes in silverstripe/cms
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Nov 7, 2024
1 parent 1bc842d commit e624ebc
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit e624ebc

Please sign in to comment.