26/02/2017 8:23am

PHP | Problem -


<?php


class ImageBlockExtension extends DataExtension
{
private static $many_many = [
'ImageBlocks' => 'ImageBlock'
];

public function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab('Root.ImageBlocks', GridField::create(
'ImageBlocks',
'Image blocks',
$this->owner->ImageBlocks(),
GridFieldConfig_RecordEditor::create()
));
}
}

class SomeDataObject extends DataObject
{

private static $extensions = ['ImageBlockExtension'];
}

class SomeOtherDataObject extends DataObject
{

private static $extensions = ['ImageBlockExtension'];
}