Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

DataObjectDecorator and CMSFields...

Go to End

2 Posts   1735 Views


Community Member, 501 Posts

23 September 2007 at 11:40pm

Ok I've found out that when I want to add fields to my member table, I should use DataObjectDecorator.

I also found out that

DataObject::add_extension('Member', 'MyExtensionOfMember');

belongs in _config.php (please add this to, wasn't obvious at all to me, but maybe I'm stupid)

Now I have:

class PhotoMemberRole extends DataObjectDecorator
function extraDBFields()
return array(
'db' => array(
'Website' => 'Varchar',
'City' => 'Varchar',
'PostalCode' => 'Int'

Now how do I add those fields to my cms? Could I just use the regular function getCMSFields() for it?

Q2: why would I need augmentDatabase()? Does it do anything else than adding fields like extraDBFields()? It probably does, but then, why do I need to use them BOTH like the forum does?


Community Member, 501 Posts

24 September 2007 at 2:47am