1 | <?php |
||
9 | class Subquery extends Expression |
||
10 | { |
||
11 | /** |
||
12 | * Query builder instance. |
||
13 | * |
||
14 | * @var \Illuminate\Database\Query\Builder |
||
15 | */ |
||
16 | protected $query; |
||
17 | |||
18 | /** |
||
19 | * Alias for the subquery. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $alias; |
||
24 | |||
25 | /** |
||
26 | * Create new subquery instance. |
||
27 | * |
||
28 | * @param \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder |
||
29 | * @param string $alias |
||
30 | */ |
||
31 | public function __construct($query, $alias = null) |
||
41 | |||
42 | /** |
||
43 | * Set underlying query builder. |
||
44 | * |
||
45 | * @param \Illuminate\Database\Query\Builder $query |
||
46 | */ |
||
47 | public function setQuery(QueryBuilder $query) |
||
51 | |||
52 | /** |
||
53 | * Get underlying query builder. |
||
54 | * |
||
55 | * @return \Illuminate\Database\Query\Builder |
||
56 | */ |
||
57 | public function getQuery() |
||
61 | |||
62 | /** |
||
63 | * Evaluate query as string. |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | public function getValue() |
||
79 | |||
80 | /** |
||
81 | * Get subquery alias. |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getAlias() |
||
89 | |||
90 | /** |
||
91 | * Set subquery alias. |
||
92 | * |
||
93 | * @param string $alias |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function setAlias($alias) |
||
102 | |||
103 | /** |
||
104 | * Pass property calls to the underlying builder. |
||
105 | * |
||
106 | * @param string $property |
||
107 | * @param mixed $value |
||
108 | * @return mixed |
||
109 | */ |
||
110 | public function __set($property, $value) |
||
114 | |||
115 | /** |
||
116 | * Pass property calls to the underlying builder. |
||
117 | * |
||
118 | * @param string $property |
||
119 | * @return mixed |
||
120 | */ |
||
121 | public function __get($property) |
||
125 | |||
126 | /** |
||
127 | * Pass method calls to the underlying builder. |
||
128 | * |
||
129 | * @param string $method |
||
130 | * @param array $params |
||
131 | * @return mixed |
||
132 | */ |
||
133 | public function __call($method, $params) |
||
137 | } |
||
138 |