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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

Decorating Member class


Go to End


2 Posts   1307 Views

Avatar
Ryan M.

Community Member, 309 Posts

26 February 2011 at 5:54pm

When you're decorating the Member class with your own stuff, do you need to refer to the new member class from then on or can you continue using 'Member'?

For example, suppose I have a Photo object and each Photo is owned by a member. Do I need to do this:

public static $has_one = array(
'Member' => 'MyMember'
);

or would this still work:

public static $has_one = array(
'Member' => 'Member'
);

I feel rather silly for asking this but I haven't decorated the Member class much in the past.

Avatar
Willr

Forum Moderator, 5523 Posts

26 February 2011 at 9:49pm

You can still refer to it as a Member. Decorators are transparent.