ExpandAsArray on 3 way join not working correctly

thread: 3 messages  |  last: a year ago  |  started: tuesday, february 16, 2010, 4:41 am pst


#1  |  brocha
Tuesday, February 16, 2010, 4:41 AM PST

Hello,

I have the following 3 tables:

Event
 id (PK)
 plan_id (FK to Plan)

Plan
 id (PK)
 name

PlanDetails
  id (PK)
  plan_id (FK to Plans)
  some_info

I want to query an event by ID and expand the plan and PlanDetails associated with the event. So I do:

Event::QueryArray(
   QQ::Equal(QQN::Event->Id, 1),
   QQ::Clause(
       QQ::Expand(QQN::Event->Plan),
               QQ::ExpandAsArray(QQN::Event->Plan->PlanDetailsAsPlan)
   )

The query that is produced is correct and returns 2 records because there are 2 details. But resulting object has only one detail populated inside Plan's __objPlanDetailsAsPlanArray.

I have tried removing the QQ::Expand(QQN::Event->Plan) clause and that has no effect.

(I am using QueryArray because QuerySingle populates __objPlanDetailsAsPlan. I saw this is a known bug that has a patch for it. But this does not seem to be related.)

When i query Plan directly and ExpandAsArray  on PlanDetailsAsPlan  this works correctly and i get 2 PlanDetails.

I am using QCodo 0.4.10

Thanks,
Brocha

#2  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Tuesday, February 16, 2010, 11:09 PM PST

Thanks for the post -- could you actually post this in the issue tracker as a bug?

#3  |  brocha
Tuesday, February 16, 2010, 11:31 PM PST

I have entered an issue #53



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.