PHPDS_query's asArray function not properly implemented

Bug #1023793 reported by Don Schoeman
6
This bug affects 1 person
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.

Tags: query asarray

Related branches

Revision history for this message
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?

Revision history for this message
Don Schoeman (don.sch) wrote :

I have already implemented this, thank you Greg.

Don Schoeman (don.sch)
Changed in phpdevshell:
status: New → Fix Committed
Revision history for this message
Greg (gregfr) wrote :

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

Revision history for this message
TitanKing (titan-phpdevshell) wrote :

Correct 3.2.1 is current stable trunk.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.