Closed Surt closed 9 years ago
It seems like a problem with the properties assignment.
Time: 293 ms, Memory: 15.00Mb
There were 5 failures:
1) EagerLoadingTests::testBelongsTo
Failed asserting that false is true.
/var/www/site/vendor/stibium/phalcon.eager-loading/tests/EagerLoadingTests.php:22
2) EagerLoadingTests::testBelongsToDeep
Failed asserting that false is true.
/var/www/site/vendor/stibium/phalcon.eager-loading/tests/EagerLoadingTests.php:60
3) EagerLoadingTests::testHasMany
Failed asserting that false is true.
/var/www/site/vendor/stibium/phalcon.eager-loading/tests/EagerLoadingTests.php:88
4) EagerLoadingTests::testHasManyToMany
Failed asserting that false is true.
/var/www/site/vendor/stibium/phalcon.eager-loading/tests/EagerLoadingTests.php:115
5) EagerLoadingTests::testManyEagerLoadsAndConstraints
Failed asserting that '8' matches expected 25.
/var/www/site/vendor/stibium/phalcon.eager-loading/tests/EagerLoadingTests.php:217
FAILURES!
Tests: 19, Assertions: 26, Failures: 5.
Hi, thanks for reporting
Are you using Phalcon 2.x, right?
@stibiumz yes, 2.0.2
Last time I checked it the problem with this was related to the ResultSets Simple using the pdo resource to traverse the results, not taking in account the "rows" already fetched, so any assignment done to it, when traversing is lost.
The problem is probably here, the property is not set. I'll try to fix it this afternoon and make sure that works well with Phalcon 2
It's working now, I've tested it with Phalcon 2.0.2 and in 1.3.4
Working as a charm! really need to move it to the incubator so many ppl can use it and the phalcon team could merge it to the framework.
Today I'll send a pull request to the incubator repo :thumbsup:
Hi, @stibiumz
with any kind of relationships I can see the eager loading executing. But when I try to access to the property with the alias of the related model it still query the database as always. Using last phalcon 2.0.2