Sprig_Core::select_list PHP Method

select_list() public method

Get all of the records for this table as an associative array.
public select_list ( $key = NULL, $value = NULL ) : array
return array key => value
    public function select_list($key = NULL, $value = NULL)
    {
        if (!$key) {
            $key = $this->pk();
        }
        if (!$value) {
            $value = $this->tk();
        }
        $query = DB::select($key, $value)->from($this->_table);
        if ($this->_sorting) {
            foreach ($this->_sorting as $field => $direction) {
                $query->order_by($field, $direction);
            }
        }
        return $query->execute($this->_db)->as_array($key, $value);
    }