17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1351 Views |
-
DataObjectDecorator and CMSFields...

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 http://doc.silverstripe.com/doku.php?id=dataobjectdecorator, 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?
-
Re: DataObjectDecorator and CMSFields...

24 September 2007 at 2:47am
Found part of my answer on:
http://doc.silverstripe.com/doku.php?id=member&s=checkmember
| 1351 Views | ||
|
Page:
1
|
Go to Top |

