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 6723439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:34:07+00:00 2026-05-26T09:34:07+00:00

I am working on a REST interface for ORM objects for a Kohana website.

  • 0

I am working on a REST interface for ORM objects for a Kohana website. I’ve got two controllers so far:

Controller_Api_Product

URL: api.example.com/product/<product_id>

Controller_Api_Category

URL: api.example.com/category/<category_id>

Each of these accepts the following methods and updates the record succesfully.

  • POST: Create
  • GET: Read
  • PUT: Update
  • DELETE: Delete

I’d like to create a some way of handling ORM’s has_many properties. For example I’d like to be able link a product and a category together. I have this relationship stored in a separate table (products_categories). I don’t have an ORM model for that table (as I don’t store any extra relationship data).

What would be the best way to manage it? Should I create an ORM model for the table and it’s own controller?

Controller_Api_Product_Category

URL: api.example/product_category/<product_category_id>

Should I use a different HTTP method (eg. LINK)?

Controller_Api_Product_Category called with method LINK

URL: api.example/product/<product_id>

Should I have some other completely different controller which isn’t bound to a specific model?

Controller_Api_Link

URL: api.example.com/link/product/<product_id>/category/<category_id>

Having a separate link controller can obviously be used for any objects. I’m just a bit stumped on how to extend my REST API beyond the normal CRUD actions.

  • 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-05-26T09:34:08+00:00Added an answer on May 26, 2026 at 9:34 am

    I’d say if you already have a link stored in table, you should use it like any other object?

     URL: api.example.com/links/<link_id>
    

    and perform CRUD operations on the link itself.

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

Sidebar

Related Questions

I'm working on a REST API. The key objects ("nouns") are "items", and each
I'm working on building the URLs for my REST API before I begin writing
I'm getting started on building a REST API for a project I'm working on,
I'm working on a largely navigation-based iPhone app that communicates with a REST API
I am working on a REST API for a web application that up until
I'm working on a REST service that has a few requirements: It has to
I am currently working on a REST library for .net, and I would like
I am currently working on a REST service. This service has an entity which
I am working on an app which calls a rest web service. Sometimes the
I am working on developing a pair of libraries to work with a REST

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.