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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

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

Custom member: Extending Member or Dataobject

Go to End

3 Posts   1306 Views


Community Member, 5 Posts

3 September 2013 at 6:29am


I am pretty new to SilverStripe and have the following situation.

I want to create a "CustomMember" data model. This "CustomMember" can login on the site (not in the CSM!) and do some actions.

On I read the following

Class Member should just be extended for entities who have some kind of login.

In my case CustomMember has some kind of login, even though not on the CSM. Currently I've implemented my CustomMember like so

class CustomMember extends DataExtension

Is this the correct way or should I instead extend Member like so

class MyMember extends Member



Community Member, 7 Posts

6 November 2013 at 9:11am

Extend Member is the correct way of doing it. Once you have done this, and you create new instances of your MyMember class, they will each have a corresponding row in the Member table in the DB with the same uid as the row in the MyMember table.

Extending Member gives you the ability to use the standard logOut(), checkPassword() etc functions on your MyMember as well as retrieving him like normal through the Member::currentUser() method to get the logged in Member.

I've just implemented this recently with a custom login form and it works well.


Community Member, 7 Posts

6 November 2013 at 10:43am

Sorry, should clarify what I said "extending Member is a good way of doing it" instead of "the correct way" - I know that it works really well for me.

To prevent them from being able to log in to the CMS, you just make sure they aren't in the Administrator user group. You could create a special group for these types of users if you want to group them.