Add SqlCriteria.join(). Refactoring SqlResultCollection (add SqlResultCollection).
This commit is contained in:
@ -33,6 +33,11 @@ abstract class SqlModel extends Model
|
||||
return $this->db->quote($value);
|
||||
}
|
||||
|
||||
public function getDb()
|
||||
{
|
||||
return $this->db;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return object
|
||||
@ -209,7 +214,7 @@ abstract class SqlModel extends Model
|
||||
$group_by = $this->db->groupByExpr($group_by);
|
||||
$order = isset($order['sort']) ? $this->order($order, $order['sort']) : false;
|
||||
$limit = $this->db->limitExpr($limit);
|
||||
$result_items = $this->fetchAll(
|
||||
$result = $this->query(
|
||||
(($sql_expression) ? $sql_expression : ('SELECT ' . $select . ' FROM ' . $this->table()))
|
||||
. (($where) ? (' WHERE ' . $where) : '')
|
||||
. (($group_by) ? (' GROUP BY ' . $group_by) : '')
|
||||
@ -218,7 +223,7 @@ abstract class SqlModel extends Model
|
||||
$sql_expression_params,
|
||||
$cache_key
|
||||
);
|
||||
return new SqlResultProvider($result_items);
|
||||
return new SqlResultProvider($result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user