ajshort:
the tip with the decorator was just what i was looking for.
execpt, it doesn't work... :(
decorating the page controller went fine.
but when i wanted to decorate the page data object, i run into errors.
here's my PageDecorator class:
class PageDecorator extends DataObjectDecorator {
function extraDBFields() {
return array(
'has_many' => array(
'FlashObjects' => 'FlashDataObject'
)
);
}
}
this code i have in the _config.php:
Object::add_extension('Page_Controller', 'PageControllerExtension');
DataObject::add_extension('Page', array_push(Page::$extensions, 'PageDecorator'));
and this errors i get, when i try to db/build?flush=1 my page:
Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING or T_VARIABLE or '$' in D:\_projekte\xtreme-diving\silverstripe\sapphire\core\Object.php(86) : eval()'d code on line 1
Fatal error: Call to a member function setOwner() on a non-object in D:\_projekte\xtreme-diving\silverstripe\sapphire\core\Object.php on line 87
could you help me out with this?
thanks!
edit: in Page.php i added: static $has_many = array();