Merge pull request #177 from creative-commoners/pulls/2/protect-hooks

API Set extension hook implementation visibility to protected
This commit is contained in:
Guy Sartorelli 2024-05-21 16:03:34 +12:00 committed by GitHub
commit f87f2c202c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 7 additions and 7 deletions

View File

@ -16,7 +16,7 @@ class FrameworkTestRole extends DataExtension
'FavouritePage' => 'SilverStripe\\CMS\\Model\\SiteTree',
);
public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab(
'Root.Main',

View File

@ -40,12 +40,12 @@ class ElementContentExtension extends Extension
}
}
public function updateCMSCompositeValidator(CompositeValidator $compositeValidator)
protected function updateCMSCompositeValidator(CompositeValidator $compositeValidator)
{
$compositeValidator->addValidator(new RequiredFields(['Title', 'MyPageID', 'MyFile']));
}
public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fields->removeByName('HTML');
$fields->addFieldToTab('Root.Main', TextField::create('MyField', 'My Field'));

View File

@ -10,7 +10,7 @@ use SilverStripe\Core\Extension;
*/
class NumericFieldExtension extends Extension
{
public function updateValidationResult($result, $validator)
protected function updateValidationResult($result, $validator)
{
if ($this->owner->Value() == 1) {
$validator->validationError($this->owner->getName(), 'This field cannot be 1');

View File

@ -34,7 +34,7 @@ class CompanyExtension extends Extension
'ManyCompanyWebSiteLink',
];
public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fields->removeByName(['CompanyWebSiteLinkID', 'ManyCompanyWebSiteLinkID']);

View File

@ -37,7 +37,7 @@ class ElementContentExtension extends Extension
'ManyLinks',
];
public function updateCMSFields($fields)
protected function updateCMSFields($fields)
{
$fields->removeByName(['OneLinkID', 'ManyLinks']);
$fields->addFieldsToTab(

View File

@ -36,7 +36,7 @@ class LinkPageExtension extends Extension
'HasManyLinks',
];
public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fields->removeByName(['Content', 'HasOneLinkID', 'HasManyLinksID']);