Advertisement
adrianstein

Call to a member function stat() on a non-object

Apr 15th, 2015
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. class ProductExtension extends DataExtension{
  3.     private static $many_many = array(
  4.         'RelatedProducts' => 'Product'
  5.     );
  6.  
  7.     private static $belongs_many_many = array(
  8.         'IsRelatedTo' => 'Product'
  9.     );
  10.  
  11.     public function updateCMSFields(FieldList $fields) {
  12.         $gridField = GridField::create('RelatedProducts',
  13.             'Related Products',
  14.             $this->owner->RelatedProducts(),
  15.             GridFieldConfig_RelationEditor::create()
  16.         );
  17.  
  18.         $fields->addFieldToTab('Root.RelatedProducts', $gridField);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement