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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:24:54+00:00 2026-05-18T04:24:54+00:00

Have been having an issue sine using the HABTM relationship in models instead of

  • 0

Have been having an issue sine using the HABTM relationship in models instead of using a JOIN in the paginate variable in the controller, data comes out fine but I can’t set the limit of projects to 20.

I am selecting projects from the DB depeneding on their features.

I havea feature called urgent.

I’m on the urgent listing page.

this should fetch all projects marked with urgent, and it does this fine but it brings back all the results instead of the limit of 20 I set in the paginate function or if I try in the models. here’s the pagien array code

$paginate = array(
   'Project' => array(
      'limit' => 20,//works fine when paginating just projects
   ),
   'Feature' => array(
      'limit' => 1, //did set this to 20 but when looking thought well its going to be the limit of the feature table which will only be 1 anyway, notl imit for the projects
      //also tried this below
      'Project' => array(
         'limit' => 20,//no luck with this
      ),
   ),
);

I use this to paginate in my controller

$this->paginate('Feature', array(..conditions..)); //this brings all my projects marked urgent but I only want 20!
  • 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-18T04:24:54+00:00Added an answer on May 18, 2026 at 4:24 am

    Are you looking for the ContainableBehavior?

    $paginate = array(
        'Feature' => array(
            'contain' => array(
                'Project' => array(
                    'limit' => 20,
                    ....
                )
            )
        )
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi, i have been having some problems using JSON data in flash builder lately
I want to describe an issue I have been having with Plot using With
I have been having an issue with updating a nullable bool value using TryUpdateModel.
I have been having this issue in iterating through an array of keys and
I have been having an issue with the $this->delete() method that deletes a record
I am having an issue with somethign that I thoguth woudl have been simple.
I have been having some issues with LINQ-To-SQL around memory usage. I'm using it
I am somewhat new to JavaScript, and have been having an issue with a
I have been having this issue with blurry text in WPF. I know that
We have been having this issue pop up sporadically, but now I can reproduce

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.