Jump to:

2510 Posts in 675 Topics by 520 members

Data Model Questions

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

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba

Page: 1
Go to End
Author Topic: 880 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
    748 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

    880 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.