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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:52:06+00:00 2026-06-08T03:52:06+00:00

Right now if I try to eager load more than two objects deep in

  • 0

Right now if I try to eager load more than two objects deep in phpactiverecord, I get an error.

Is something such as this:

$conditions['include'] = array( 'playlists' => array('playlist_songs' =>array('song')));
User::find('first', $conditions);

Just one level too much to try to retrieve?
I’m getting an error Undefined offset: 0 whenever I try to use an association 3 levels deep.
Thanks for any help or insight :D.

Edit:

So I’ve found a pattern that’s a little odd.
If I have array('playlist_songs'=>array('song'=>array('album')));, the eager load will break for me. But if I add another association to the array, it then works correctly.
array('playlist_songs'=>array('song','song','song','song'=>array('album')));

I used ‘song’ multiple times in that array just to make the fix very apparent.

  • 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-08T03:52:07+00:00Added an answer on June 8, 2026 at 3:52 am

    Just fixed this for myself by changing line 247 of Table.php in execute_eager_load from

    if (is_array($name))
    {
                $nested_includes = count($name) > 1 ? $name : $name[0];//<-- this line
                $name = $index;
    }
    

    to

    if (is_array($name))
    {
                $nested_includes = count($name) > 0 ? $name : $name[0];
                $name = $index;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now we just use something like this stopWatch.Start(); try { method(); } finally
I'm learned php as functional and procedure language. Right now try to start learn
I am coming from Java and try to learn Javascript right now. Doing that
I'm quite new to ZF, and right now, i try to write a tiny
Right now I have a script that will get the last five files in
I'm new to WFP and try to learn it via different examples. Right now
Right now, my project has two classes and a main. Since the two classes
I'm just learning JavaScript right now, so please do try and explain with that
How do i show an IsBalloon ToolTip in WinForms? Right now i try: ToolTip
Right now, I do this: try: blah except Exception, e: print e time.sleep(9999) Instead

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.