mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
API Set extension hook implementation visibility to protected
This commit is contained in:
parent
fcd4ddc0b1
commit
1417d90b4e
@ -54,7 +54,7 @@ class UserFormFieldEditorExtension extends DataExtension
|
|||||||
*
|
*
|
||||||
* @return FieldList
|
* @return FieldList
|
||||||
*/
|
*/
|
||||||
public function updateCMSFields(FieldList $fields)
|
protected function updateCMSFields(FieldList $fields)
|
||||||
{
|
{
|
||||||
$fieldEditor = $this->getFieldEditorGrid();
|
$fieldEditor = $this->getFieldEditorGrid();
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ class UserFormFieldEditorExtension extends DataExtension
|
|||||||
/**
|
/**
|
||||||
* Ensure that at least one page exists at the start
|
* Ensure that at least one page exists at the start
|
||||||
*/
|
*/
|
||||||
public function onAfterWrite()
|
protected function onAfterWrite()
|
||||||
{
|
{
|
||||||
$this->createInitialFormStep();
|
$this->createInitialFormStep();
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ class UserFormFieldEditorExtension extends DataExtension
|
|||||||
/**
|
/**
|
||||||
* Remove any orphaned child records on publish
|
* Remove any orphaned child records on publish
|
||||||
*/
|
*/
|
||||||
public function onAfterPublish()
|
protected function onAfterPublish()
|
||||||
{
|
{
|
||||||
// store IDs of fields we've published
|
// store IDs of fields we've published
|
||||||
$seenIDs = [];
|
$seenIDs = [];
|
||||||
@ -220,7 +220,7 @@ class UserFormFieldEditorExtension extends DataExtension
|
|||||||
/**
|
/**
|
||||||
* Remove all fields from the live stage when unpublishing the page
|
* Remove all fields from the live stage when unpublishing the page
|
||||||
*/
|
*/
|
||||||
public function onAfterUnpublish()
|
protected function onAfterUnpublish()
|
||||||
{
|
{
|
||||||
foreach ($this->owner->Fields() as $field) {
|
foreach ($this->owner->Fields() as $field) {
|
||||||
$field->deleteFromStage(Versioned::LIVE);
|
$field->deleteFromStage(Versioned::LIVE);
|
||||||
@ -236,7 +236,7 @@ class UserFormFieldEditorExtension extends DataExtension
|
|||||||
* @param string $manyMany
|
* @param string $manyMany
|
||||||
* @return DataObject
|
* @return DataObject
|
||||||
*/
|
*/
|
||||||
public function onAfterDuplicate($oldPage, $doWrite, $manyMany)
|
protected function onAfterDuplicate($oldPage, $doWrite, $manyMany)
|
||||||
{
|
{
|
||||||
// List of EditableFieldGroups, where the key of the array is the ID of the old end group
|
// List of EditableFieldGroups, where the key of the array is the ID of the old end group
|
||||||
$fieldGroups = [];
|
$fieldGroups = [];
|
||||||
@ -289,7 +289,7 @@ class UserFormFieldEditorExtension extends DataExtension
|
|||||||
/**
|
/**
|
||||||
* @see Versioned::doRevertToLive
|
* @see Versioned::doRevertToLive
|
||||||
*/
|
*/
|
||||||
public function onAfterRevertToLive()
|
protected function onAfterRevertToLive()
|
||||||
{
|
{
|
||||||
foreach ($this->owner->Fields() as $field) {
|
foreach ($this->owner->Fields() as $field) {
|
||||||
$field->copyVersionToStage(Versioned::LIVE, Versioned::DRAFT);
|
$field->copyVersionToStage(Versioned::LIVE, Versioned::DRAFT);
|
||||||
|
@ -44,7 +44,7 @@ class UserFormFileExtension extends DataExtension
|
|||||||
* @param bool $value
|
* @param bool $value
|
||||||
* @see File::isTrackedFormUpload(), UserDefinedFormController::process()
|
* @see File::isTrackedFormUpload(), UserDefinedFormController::process()
|
||||||
*/
|
*/
|
||||||
public function updateTrackedFormUpload(&$value): void
|
protected function updateTrackedFormUpload(&$value): void
|
||||||
{
|
{
|
||||||
$file = $this->owner;
|
$file = $this->owner;
|
||||||
if ($file->UserFormUpload != self::USER_FORM_UPLOAD_UNKNOWN) {
|
if ($file->UserFormUpload != self::USER_FORM_UPLOAD_UNKNOWN) {
|
||||||
|
@ -23,7 +23,7 @@ class UsedOnTableExtension extends Extension
|
|||||||
* @param array $ancestorDataObjects
|
* @param array $ancestorDataObjects
|
||||||
* @param DataObject $dataObject|null
|
* @param DataObject $dataObject|null
|
||||||
*/
|
*/
|
||||||
public function updateUsageDataObject(?DataObject &$dataObject)
|
protected function updateUsageDataObject(?DataObject &$dataObject)
|
||||||
{
|
{
|
||||||
if (!($dataObject instanceof SubmittedFileField)) {
|
if (!($dataObject instanceof SubmittedFileField)) {
|
||||||
return;
|
return;
|
||||||
@ -41,7 +41,7 @@ class UsedOnTableExtension extends Extension
|
|||||||
* @param array $ancestorDataObjects
|
* @param array $ancestorDataObjects
|
||||||
* @param DataObject $dataObject
|
* @param DataObject $dataObject
|
||||||
*/
|
*/
|
||||||
public function updateUsageAncestorDataObjects(array &$ancestorDataObjects, DataObject $dataObject)
|
protected function updateUsageAncestorDataObjects(array &$ancestorDataObjects, DataObject $dataObject)
|
||||||
{
|
{
|
||||||
// SubmittedFileField was changed to a Submitted Form in updateUsageModifyOrExcludeDataObject()
|
// SubmittedFileField was changed to a Submitted Form in updateUsageModifyOrExcludeDataObject()
|
||||||
if (!($dataObject instanceof SubmittedForm)) {
|
if (!($dataObject instanceof SubmittedForm)) {
|
||||||
|
@ -421,7 +421,7 @@ class EditableFormField extends DataObject
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onBeforeWrite()
|
protected function onBeforeWrite()
|
||||||
{
|
{
|
||||||
parent::onBeforeWrite();
|
parent::onBeforeWrite();
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ class EditableFieldGroupEnd extends EditableFormField
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onAfterWrite()
|
protected function onAfterWrite()
|
||||||
{
|
{
|
||||||
parent::onAfterWrite();
|
parent::onAfterWrite();
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ class EditableFileField extends EditableFormField
|
|||||||
return round(static::get_php_max_file_size() / 1024 / 1024, 1);
|
return round(static::get_php_max_file_size() / 1024 / 1024, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onBeforeWrite()
|
protected function onBeforeWrite()
|
||||||
{
|
{
|
||||||
parent::onBeforeWrite();
|
parent::onBeforeWrite();
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ class EmailRecipient extends DataObject
|
|||||||
DB::query("UPDATE \"UserDefinedForm_EmailRecipient\" SET \"FormClass\" = 'Page' WHERE \"FormClass\" IS NULL");
|
DB::query("UPDATE \"UserDefinedForm_EmailRecipient\" SET \"FormClass\" = 'Page' WHERE \"FormClass\" IS NULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onBeforeWrite()
|
protected function onBeforeWrite()
|
||||||
{
|
{
|
||||||
parent::onBeforeWrite();
|
parent::onBeforeWrite();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user