Hi All,
I'm forking the Calendar_Event module to produce a SportsEvent calendar with custom searching.
I've added a Sport DataObject with the following code:
class Sport extends DataObject {
static $db = array (
"Name" => "Text"
);
static $has_one = array ();
static $belongs_many_many = array (
"Events" => "CalendarEvent"
);
static $summary_fields = array (
"Name"
);
public function getCMSFields_forPopup(){
$fields = new FieldSet ();
$fields->push ( new TextField ( 'Name', 'Sport Name' ));
return $fields;
}
}
and I've updated the settings in CalendarEvent as follows:
static $many_many = array (
'RecurringDaysOfWeek' => 'RecurringDayOfWeek',
'RecurringDaysOfMonth' => 'RecurringDayOfMonth',
"Sports" => "Sport"
);
My MMDOM code is:
$sportsTable = new ManyManyDataObjectManager (
$this,
"Event Sports",
"Sport",
array (
"Name" => "Sport Name"
),
"getCMSFields_forPopup"
);
$sportsTable->setParentClass("CalendarEvent");
$sportsTable->setAddTitle ("a Sport");
$f->addFieldToTab ( "Root.Content.Sports", $sportsTable );
But I'm getting the error "Fatal error: Cannot instantiate abstract class Object in /home/www/sportspost/sportspost.co.nz/sapphire/core/Object.php on line 115" whenever I try to use the CMS. I've narrowed it down to the MMDOM call but I can't seems to work out where I am going wrong in my code.
Can anyone help?
Cheers
James.