Issues (135)

src/Extensions/TaxonomyTermExtension.php (2 issues)

Severity
1
<?php
2
3
namespace CWP\CWP\Extensions;
4
5
use CWP\CWP\PageTypes\BasePage;
6
use SilverStripe\ORM\DataExtension;
7
use SilverStripe\Forms\FieldList;
8
use SilverStripe\Forms\GridField\GridFieldAddNewButton;
9
10
class TaxonomyTermExtension extends DataExtension
11
{
12
13
    private static $api_access = true;
0 ignored issues
show
The private property $api_access is not used, and could be removed.
Loading history...
14
15
    private static $belongs_many_many = array(
0 ignored issues
show
The private property $belongs_many_many is not used, and could be removed.
Loading history...
16
        'Pages' => BasePage::class
17
    );
18
19
    public function updateCMSFields(FieldList $fields)
20
    {
21
        $pagesGridField = $fields->dataFieldByName('Pages');
22
        if ($pagesGridField) {
23
            $pagesGridField->getConfig()->removeComponentsByType(GridFieldAddNewButton::class);
24
        }
25
    }
26
}
27