-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy pathQueryBuilder.php
More file actions
45 lines (38 loc) · 1005 Bytes
/
QueryBuilder.php
File metadata and controls
45 lines (38 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php namespace October\Rain\Database;
use Illuminate\Database\Query\Builder as QueryBuilderBase;
/**
* QueryBuilder restores some features that were removed from base, it also
* adds some new ones
*
* @package october\database
* @author Alexey Bobkov, Samuel Georges
*/
class QueryBuilder extends QueryBuilderBase
{
/**
* Get an array with the values of a given column.
*
* @param string $column
* @param string|null $key
* @return array
*/
public function lists($column, $key = null)
{
return $this->pluck($column, $key)->all();
}
/**
* Retrieve the "count" result of the query,
* also strips off any orderBy clause.
*
* @param string $columns
* @return int
*/
public function count($columns = '*')
{
$previousOrders = $this->orders;
$this->orders = null;
$result = parent::count($columns);
$this->orders = $previousOrders;
return $result;
}
}