Granada\ORM::_get_instances PHP Method

_get_instances() protected method

Create instances of each row in the result and map them to an associative array with the primary IDs as the array keys.
protected _get_instances ( array $rows ) : array
$rows array
return array
    protected function _get_instances($rows)
    {
        $size = count($rows);
        $instances = array();
        for ($i = 0; $i < $size; $i++) {
            $row = $this->_create_instance_from_row($rows[$i]);
            $key = isset($row->{$this->_instance_id_column}) && $this->_associative_results ? $row->id() : $i;
            $instances[$key] = $row;
        }
        return $instances;
    }
ORM