Skip to content

Commit

Permalink
API Standardise extension hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Aug 19, 2024
1 parent ff1b8dd commit 41213bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Extensions/FileSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function onAfterUpload()
$this->owner->write();
}

public function canEdit($member = null)
protected function canEdit($member = null)
{
// Opt out of making opinions if no subsite ID is set yet
if (!$this->owner->SubsiteID) {
Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/GroupSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GroupSubsites extends DataExtension implements PermissionProvider
/**
* Migrations for GroupSubsites data.
*/
public function requireDefaultRecords()
protected function onRequireDefaultRecords()
{
if (!$this->owner) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Extensions/LeftAndMainSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LeftAndMainSubsites extends LeftAndMainExtension
*/
private static $treats_subsite_0_as_global = false;

public function init()
protected function onInit()
{
Requirements::css('silverstripe/subsites:client/dist/styles/LeftAndMain_Subsites.css');
Requirements::javascript('silverstripe/subsites:client/dist/js/LeftAndMain_Subsites.js');
Expand Down Expand Up @@ -223,7 +223,7 @@ public function shouldChangeSubsite($adminClass, $recordSubsiteID, $currentSubsi
*
* @param Member $member
*/
public function canAccess(Member $member = null)
protected function canAccess(Member $member = null)
{
if (!$member) {
$member = Security::getCurrentUser();
Expand Down
12 changes: 6 additions & 6 deletions src/Extensions/SiteTreeSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ protected function alternateSiteConfig()
* @param Member|null $member
* @return bool|null
*/
public function canEdit($member = null)
protected function canEdit($member = null)
{
if (!$member) {
$member = Security::getCurrentUser();
Expand Down Expand Up @@ -351,7 +351,7 @@ public function canEdit($member = null)
* @param null $member
* @return bool
*/
public function canDelete($member = null)
protected function canDelete($member = null)
{
if (!$member && $member !== false) {
$member = Security::getCurrentUser();
Expand All @@ -364,7 +364,7 @@ public function canDelete($member = null)
* @param null $member
* @return bool
*/
public function canAddChildren($member = null)
protected function canAddChildren($member = null)
{
if (!$member && $member !== false) {
$member = Security::getCurrentUser();
Expand All @@ -377,7 +377,7 @@ public function canAddChildren($member = null)
* @param Member|null $member
* @return bool|null
*/
public function canPublish($member = null)
protected function canPublish($member = null)
{
if (!$member && $member !== false) {
$member = Security::getCurrentUser();
Expand Down Expand Up @@ -445,7 +445,7 @@ protected function updatePreviewLink(&$link, $action = null)
* @param $tags
* @return string
*/
public function MetaTags(&$tags)
protected function updateMetaTags(&$tags)
{
if ($this->owner->SubsiteID) {
$tags .= '<meta name="x-subsite-id" content="' . $this->owner->SubsiteID . "\" />\n";
Expand Down Expand Up @@ -527,7 +527,7 @@ protected function cacheKeyComponent()
* @param Member $member
* @return boolean|null
*/
public function canCreate($member = null)
protected function canCreate($member = null)
{
// Typically called on a singleton, so we're not using the Subsite() relation
$subsite = Subsite::currentSubsite();
Expand Down

0 comments on commit 41213bd

Please sign in to comment.