PHPDS_query's asArray function not properly implemented

Bug #1023793 reported by Don Schoeman on 2012-07-12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
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

Greg (gregfr) wrote :

You could just override getResults() and call asArray(), but a flag is a good idea.
Do you want me to add this?

Don Schoeman (don.sch) wrote :

I have already implemented this, thank you Greg.

Don Schoeman (don.sch) on 2012-07-12
Changed in phpdevshell:
status: New → Fix Committed
Greg (gregfr) wrote :

Don it seems you pushed to 3.1.4 instead of 3.2.1 is it on purpose?

TitanKing (titan-phpdevshell) wrote :

Correct 3.2.1 is current stable trunk.

Greg (gregfr) on 2013-06-11
Changed in phpdevshell:
milestone: 3.2.1-stable → 3.5
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers