ktsv
(Ktsv12)
December 15, 2014, 9:29am
1
Hi everybody.
I’m expierincing strange issue atm.
I have a DB query through relational AR - joining 3 tables to basic table and 5 more tables in chain.
It works, unless I add $criteria->limit or $criteria->offset (or both). When I do it - table chain failing to add to query.
I’m stuck. Help me somebody
Have you tried to execute sql expression outside Yii?
Limit and offeset work at root level of query.
ktsv
(Ktsv12)
December 15, 2014, 9:55am
3
Problem is that when I add limit and offeset - AR don’t join some table I need and asked to join, and that are joinning perfectly without L&O.
If i don’t set L&O - anything works fine.
Have you tried to compare sql with and without L&O in firebug? So you can see complete sql.
ktsv
(Ktsv12)
December 15, 2014, 10:20am
5
OK, I found out what happens - one of relations in chain is of HAS_MANY type, so query splits into two queries and bacause one of conditions is adressed to second query, but trying to execute with second one - my code fails.
Thank you anyway
Post your code that fails.
ktsv
(Ktsv12)
December 15, 2014, 10:26am
7
I’ve allready figured out what happens. I’m not sure what to do with it, but at least, I have a light in the end of a tonnel now