From e2e7dc17b968da585ccfc8ffb63c82af5a359572 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 20 May 2024 17:07:06 +1200 Subject: [PATCH] API Set extension hook implementation visibility to protected --- src/DataObjects/WorkflowAction.php | 4 ++-- src/DataObjects/WorkflowDefinition.php | 6 +++--- src/DataObjects/WorkflowInstance.php | 2 +- src/DataObjects/WorkflowTransition.php | 2 +- src/Extensions/AdvancedWorkflowExtension.php | 2 +- src/Extensions/FileWorkflowApplicable.php | 6 +++--- src/Extensions/WorkflowApplicable.php | 8 ++++---- src/Extensions/WorkflowEmbargoExpiryExtension.php | 8 ++++---- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/DataObjects/WorkflowAction.php b/src/DataObjects/WorkflowAction.php index d962f6a7..d9471f14 100644 --- a/src/DataObjects/WorkflowAction.php +++ b/src/DataObjects/WorkflowAction.php @@ -185,7 +185,7 @@ public function execute(WorkflowInstance $workflow) return true; } - public function onBeforeWrite() + protected function onBeforeWrite() { if (!$this->Sort) { $this->Sort = DB::query('SELECT MAX("Sort") + 1 FROM "WorkflowAction"')->value(); @@ -199,7 +199,7 @@ public function onBeforeWrite() * are deleted * Also removes all outbound transitions */ - public function onAfterDelete() + protected function onAfterDelete() { parent::onAfterDelete(); $wfActionInstances = WorkflowActionInstance::get() diff --git a/src/DataObjects/WorkflowDefinition.php b/src/DataObjects/WorkflowDefinition.php index 58d58bb1..815cd428 100644 --- a/src/DataObjects/WorkflowDefinition.php +++ b/src/DataObjects/WorkflowDefinition.php @@ -121,7 +121,7 @@ public function getInitialAction() /** * Ensure a sort value is set and we get a useable initial workflow title. */ - public function onBeforeWrite() + protected function onBeforeWrite() { if (!$this->Sort) { $this->Sort = DB::query('SELECT MAX("Sort") + 1 FROM "WorkflowDefinition"')->value(); @@ -137,7 +137,7 @@ public function onBeforeWrite() * After we've been written, check whether we've got a template and to then * create the relevant actions etc. */ - public function onAfterWrite() + protected function onAfterWrite() { parent::onAfterWrite(); @@ -158,7 +158,7 @@ public function onAfterWrite() * * @return null */ - public function onBeforeDelete() + protected function onBeforeDelete() { parent::onBeforeDelete(); diff --git a/src/DataObjects/WorkflowInstance.php b/src/DataObjects/WorkflowInstance.php index 5afab255..d32631d0 100644 --- a/src/DataObjects/WorkflowInstance.php +++ b/src/DataObjects/WorkflowInstance.php @@ -189,7 +189,7 @@ public function fieldLabels($includerelations = true) /** * See if we've been saved in context of managing the workflow directly */ - public function onBeforeWrite() + protected function onBeforeWrite() { parent::onBeforeWrite(); diff --git a/src/DataObjects/WorkflowTransition.php b/src/DataObjects/WorkflowTransition.php index 56acdd73..61182e5d 100644 --- a/src/DataObjects/WorkflowTransition.php +++ b/src/DataObjects/WorkflowTransition.php @@ -87,7 +87,7 @@ public function isValid(WorkflowInstance $workflow) /** * Before saving, make sure we're not in an infinite loop */ - public function onBeforeWrite() + protected function onBeforeWrite() { if (!$this->Sort) { $this->Sort = DB::query('SELECT MAX("Sort") + 1 FROM "WorkflowTransition"')->value(); diff --git a/src/Extensions/AdvancedWorkflowExtension.php b/src/Extensions/AdvancedWorkflowExtension.php index b5059365..427d0e84 100644 --- a/src/Extensions/AdvancedWorkflowExtension.php +++ b/src/Extensions/AdvancedWorkflowExtension.php @@ -106,7 +106,7 @@ public function updateEditForm(Form $form) /** * @param Form $form */ - public function updateItemEditForm($form) + protected function updateItemEditForm($form) { /** @var DataObject $record */ $record = $form->getRecord(); diff --git a/src/Extensions/FileWorkflowApplicable.php b/src/Extensions/FileWorkflowApplicable.php index b473751f..adbfe0f2 100644 --- a/src/Extensions/FileWorkflowApplicable.php +++ b/src/Extensions/FileWorkflowApplicable.php @@ -17,13 +17,13 @@ */ class FileWorkflowApplicable extends WorkflowApplicable { - public function updateSummaryFields(&$fields) + protected function updateSummaryFields(&$fields) { $fields['ID'] = 'ID'; $fields['ParentID'] = 'ParentID'; } - public function updateCMSFields(FieldList $fields) + protected function updateCMSFields(FieldList $fields) { if (!$this->owner->ID) { return $fields; @@ -49,7 +49,7 @@ public function updateCMSFields(FieldList $fields) } } - public function onAfterWrite() + protected function onAfterWrite() { parent::onAfterWrite(); diff --git a/src/Extensions/WorkflowApplicable.php b/src/Extensions/WorkflowApplicable.php index 65142a95..c919df6b 100644 --- a/src/Extensions/WorkflowApplicable.php +++ b/src/Extensions/WorkflowApplicable.php @@ -106,12 +106,12 @@ public function isPublishJobRunning() */ protected $currentInstance; - public function updateSettingsFields(FieldList $fields) + protected function updateSettingsFields(FieldList $fields) { $this->updateFields($fields); } - public function updateCMSFields(FieldList $fields) + protected function updateCMSFields(FieldList $fields) { if (!$this->owner->hasMethod('getSettingsFields')) { $this->updateFields($fields); @@ -184,7 +184,7 @@ public function updateFields(FieldList $fields) } } - public function updateCMSActions(FieldList $actions) + protected function updateCMSActions(FieldList $actions) { $active = $this->getWorkflowService()->getWorkflowFor($this->owner); $c = Controller::curr(); @@ -325,7 +325,7 @@ public function LinkToPendingItems() * After a workflow item is written, we notify the * workflow so that it can take action if needbe */ - public function onAfterWrite() + protected function onAfterWrite() { $instance = $this->getWorkflowInstance(); if ($instance && $instance->CurrentActionID) { diff --git a/src/Extensions/WorkflowEmbargoExpiryExtension.php b/src/Extensions/WorkflowEmbargoExpiryExtension.php index d05242c8..b489051c 100644 --- a/src/Extensions/WorkflowEmbargoExpiryExtension.php +++ b/src/Extensions/WorkflowEmbargoExpiryExtension.php @@ -91,7 +91,7 @@ class WorkflowEmbargoExpiryExtension extends DataExtension /** * @param FieldList $fields */ - public function updateCMSFields(FieldList $fields) + protected function updateCMSFields(FieldList $fields) { // requirements // ------------ @@ -246,7 +246,7 @@ protected function ensureUnPublishJob($when) ->queueJob($job, $when ? date('Y-m-d H:i:s', $when) : null); } - public function onBeforeDuplicate($original, $doWrite) + protected function onBeforeDuplicate($original, $doWrite) { $clone = $this->owner; @@ -259,7 +259,7 @@ public function onBeforeDuplicate($original, $doWrite) /** * {@see PublishItemWorkflowAction} for approval of requested publish dates */ - public function onBeforeWrite() + protected function onBeforeWrite() { parent::onBeforeWrite(); @@ -341,7 +341,7 @@ public function onBeforeWrite() * * @param $flags */ - public function updateStatusFlags(&$flags) + protected function updateStatusFlags(&$flags) { $embargo = $this->getIsPublishScheduled(); $expiry = $this->getIsUnPublishScheduled();