Jump to:

3429 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » RestfulServer and custom classes?

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

Page: 1
Go to End
Author Topic: 1187 Views
  • Mange
    Avatar
    Community Member
    3 Posts

    RestfulServer and custom classes? Link to this post

    Hello!

    I'm experimenting with the restfulserver (http://doc.silverstripe.org/doku.php?id=restfulserver) to manipulate the "Member" object and I think it would be useful for my project, however I'd like to avoid any modifications to the actual SS core files and keep my changes to code in "mysite".

    Is this possible?

    regards,
    Mange

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: RestfulServer and custom classes? Link to this post

    You can subclass RestfulServer and use custom routing:

    Director::addRules(100, array(
       'api/v1//Member => 'CustomMemberRestfulServer'
    ));

    For adding properties to the built-in Member class, read up about DataObjectDecorator

    1187 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.