for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace CWP\CWP\Extensions;
use CWP\CWP\PageTypes\BasePage;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridFieldAddNewButton;
class TaxonomyTermExtension extends DataExtension
{
private static $api_access = true;
$api_access
private static $belongs_many_many = array(
$belongs_many_many
'Pages' => BasePage::class
);
public function updateCMSFields(FieldList $fields)
$pagesGridField = $fields->dataFieldByName('Pages');
if ($pagesGridField) {
$pagesGridField
SilverStripe\Forms\FormField
true
$pagesGridField->getConfig()->removeComponentsByType(GridFieldAddNewButton::class);
}