Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8634979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:51:31+00:00 2026-06-12T09:51:31+00:00

I am a little confused on how to go about using the RESTful server

  • 0

I am a little confused on how to go about using the RESTful server API in SilverStripe 3. I have just starting learning and the following has confused me.

All content on our site is stored in a database. Each class that is a child of the DataObject class will have its own table in our database.

Every object of such a class will correspond to a row in that table – this is our "data object", the "model" of Model-View-Controller. A page type has a data object that represents all the data for our page. Rather than inheriting directly from DataObject, it inherits from SiteTree. We generally create a "Page" data object, and subclass this for all other page types. This allows us to define behavior that is consistent across all pages in our site.

I have done this to set up pages but now I am learning about the RESTful server API and it says to create an object that extends DataObject.

Forgive my ignorance but would extending SiteTree not be the same thing?

Very confused so would appreciate some enlightenment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:51:32+00:00Added an answer on June 12, 2026 at 9:51 am

    As commented above, if you extend SiteTree, then you are extending DataObject, but getting a lot of overhead. Some of this overhead may be useful to you, as SiteTree provides Versioning, Hierarchies and other nice tricks which make it a good class for Pages in your site.

    However, if you are wanting to manage a lot of objects, or if you aren’t using the Hierarchy or Versioning models, or if you just want to customize how the objects are presented or managed in the CMS, then it is better to extend DataObject directly. There are various tutorials on this on the SilverStripe documentation site, and on SSBits

    This may also be useful to you.

    Once you have your DataObject subclass working well for you, you can start to add the RestfulServer capabilities to it. The most basic way to do this is to add a static property to your class:

    static $api_access = true; 
    

    More information about using RestfulServer is available here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a little confused about when do I have to serialize objects using
I am a little confused about Accept-Encoding . I have Web Service which would
I am a little confused about the roles of a java application server and
I'm a little confused about using release vs. debug versions of a dll for
I'm a little confused about clean-up order when you're using PThreads with regard to
I am a little confused about the benefits or conc using scriptmanager with ajax
I'm a little confused about how to print a character to the screen using
Apologies -- I'm a newbie using Ruby on Rails. Still a little confused about
I'm a little confused about egg files and installing them using easy_install, hope you
I am a little confused about how to build a LRU cache by using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.