Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: 1.2.1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Using php 5.2.9 on wamp / Windows XP
Description
When trying to use 'findBy' magic method this way :
Doctrine::getTable('Article')->findByIsPublishedAndIsModerate(Array(true,true),DOCTRINE::HYDRATE_ARRAY);
It does not work because there is a bug in the __call magic method whereas calling
Doctrine::getTable('Article')->findBy("IsPublishedAndIsModerate",Array(true,true),DOCTRINE::HYDRATE_ARRAY);
works fine
Hydration mode is not set to specified value and the arguments are encapsulated into a non necessary array.
Please find the Table.php attached with the correction to make it work.
line 2771 : '>' operator should be replaced with a '>=' operator
line 2789 : '$arguments' should be replaced by '$arguments[0]' on the line 'return $this->$method($by, $arguments[0], $hydrationMode);'
Thank you for including this patch in the next release.
The syntax should be:
Doctrine::getTable('Article')->findByIsPublishedAndIsModerate(true,true, DOCTRINE::HYDRATE_ARRAY);