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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:03:44+00:00 2026-06-14T18:03:44+00:00

I have an User Model which uses a standard MySQL database and users table

  • 0

I have an User Model which uses a standard MySQL database and users table and a Movie Model which is a datasource from Rotten Tomatoes. They have a hasAndBelongsToMany relationship and I’m successfully able to write to the join table users_movies which holds the user_id and movie_id (the movie_id is the Rotten Tomatoes id). Works great.

The trouble is retrieving an User’s movies. The standard find:

$movies = $this->User->find('all', array('conditions' => array('id' => $user_id)));

only returns the User not the associated Movie(s). I put a die statement in my read method in the DataSource and it’s not even reaching the read method. How can I go about retrieving an User’s movies?

  • 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-14T18:03:45+00:00Added an answer on June 14, 2026 at 6:03 pm

    So Rotten Tomatoes is holding your movies? In that case, of course Rotten Tomatoes wouldn’t allow direct SQL access to their database – you’d be accessing it via an API. So Cake definitely won’t just be able to join Users to Movies the way it normally would with two tables in the same database.

    What you’ll have to do is 1) get a list of the user’s movie_id’s from Cake, and then 2) Call the Rotten Tomatoes API to get a list of movies where their ID is in your list of movie_id’s. (That’s assuming rotten tomatoes allows such an API call.)

    Having a quick look at the API, it looks like their ‘movies search’ (http://developer.rottentomatoes.com/docs/json/v10/Movies_Search) only allows you to specify plain-text as the search criteria (ie, you can’t search based on movie id’s). And their ‘movie info’ method (http://developer.rottentomatoes.com/docs/json/v10/Movie_Info), which does allow you to retrieve a movie by id, only allows you to retrieve one movie at a time.

    You could of course loop through your list of movie id’s for a given user, and make a separate API call to rotten tomatoes for each one – though I’d imagine that would get VERY slow.

    Someone has put in a feature request for retrieving based on a list of multiple id’s (http://developer.rottentomatoes.com/forum/read/123940) but until that request gets implemented, you will probably be having a tough time getting anything decent working.

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

Sidebar

Related Questions

I have a User Model, a UsersController and an AccountController which uses the User
I have a simple User model which is associated to many Town objects using
I have a user model on which I check to make sure that the
I have 2 models: User and Book and a join model ownership which connect
I have a sort of plug-in model in which various complex user controls are
Ive got the following problem. I have a model called user which has a
i have a class User which extends Ebean Model. And i defined a dbfile
I have a list_users model with fields (id, list_id, user_id) which joins Users w
Hi I have a Collection which uses fetch() to do the initial fetch from
I have a model exposed in Django's admin, which uses ModelAdmin's readonly_fields list to

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.