Hi!
I've a 1to1 relationship between a Page class and a DataObject:
class Member extends DataObject {
static $db = array(
'FirstName' => 'Text',
...
)
}
class MemberFounderPage extends Page {
static $has_one = array(
'MyMember' => 'Member'
);
static $db = array(
'MemberSince' => 'Date',
...
);
...
}
And I want to push the Member fields into the MemberFounderPage getCMSFields() method, but I'm having trouble with it. I tried to define a getCMSFields() method into the DataObject, and calling it from the MemberFounderPage one:
class MemberFounderPage extends Page {
...
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldsToTab("Root.Content.Main", $this->MyMember()->getCMSFields());
...
return $fields;
}
...
}
The fields appear on the tab, but they're not saved when saving.
Any hint would be appreciated.
Thanks