PHPDS_query's asArray function not properly implemented
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PHPDevShell |
Fix Committed
|
Medium
|
Don Schoeman |
Bug Description
The asArray function in the PHPDS_query class is not properly implemented. It is supposed to fetch a single field as a simple one dimensional numerical array, i.e. array([0] => "value a", [1] = "value b", ...). PHPDS_query itself never calls this function and the end developer also can't call it in the PHPDS_query derived classes since it will always return with an empty result. (The reason is that by the time the end developer calls the asArray function the result set has already been parsed by the invoke() function and so the result pointer is already passed the last row.)
In order to make this function usefull we need to add an optional flag to the PHPDS_query class that will allow invoke() to make use of the asArray function and return the result as required.
Related branches
Changed in phpdevshell: | |
status: | New → Fix Committed |
Changed in phpdevshell: | |
milestone: | 3.2.1-stable → 3.5 |
You could just override getResults() and call asArray(), but a flag is a good idea.
Do you want me to add this?