Add assoc method into SqlResultCollection
This commit is contained in:
@ -19,7 +19,7 @@ class SqlResultProvider implements iSqlResultItems
|
||||
private $result_items_base;
|
||||
|
||||
/**
|
||||
* @param $result DbStatement
|
||||
* @param $result DbStatement|array
|
||||
*/
|
||||
public function __construct($result)
|
||||
{
|
||||
@ -29,8 +29,12 @@ class SqlResultProvider implements iSqlResultItems
|
||||
private function defineResultItems()
|
||||
{
|
||||
if (is_null($this->result_items_base)) {
|
||||
$this->result_items_base = $this->result->fetchAll();
|
||||
$this->result_items = $this->result_items_base;
|
||||
if (is_array($this->result)) {
|
||||
$this->result_items_base = $this->result;
|
||||
} else {
|
||||
$this->result_items_base = $this->result->fetchAll();
|
||||
}
|
||||
$this->result_items = $this->result_items_base;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user