Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ProductExtension extends DataExtension{
- private static $many_many = array(
- 'RelatedProducts' => 'Product'
- );
- private static $belongs_many_many = array(
- 'IsRelatedTo' => 'Product'
- );
- public function updateCMSFields(FieldList $fields) {
- $gridField = GridField::create('RelatedProducts',
- 'Related Products',
- $this->owner->RelatedProducts(),
- GridFieldConfig_RelationEditor::create()
- );
- $fields->addFieldToTab('Root.RelatedProducts', $gridField);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement