1 | <?php |
||
20 | trait TokenEnvironmentAttributeTrait |
||
21 | { |
||
22 | /** |
||
23 | * @var string|string[]|null The environment(s). Prefix with "not " to exclude them. |
||
24 | */ |
||
25 | public $environment; |
||
26 | |||
27 | /** |
||
28 | * Adds an additional WHERE condition to the existing one. |
||
29 | * The new condition and the existing one will be joined using the `AND` operator. |
||
30 | * @param string|array|Expression $condition the new WHERE condition. Please refer to [[where()]] |
||
31 | * on how to specify this parameter. |
||
32 | * @param array $params the parameters (name => value) to be bound to the query. |
||
33 | * @return $this the query object itself |
||
34 | * @see where() |
||
35 | * @see orWhere() |
||
36 | */ |
||
37 | abstract public function andWhere($condition, $params = []); |
||
38 | |||
39 | /** |
||
40 | * Appends a LEFT OUTER JOIN part to the query. |
||
41 | * @param string|array $table the table to be joined. |
||
42 | * |
||
43 | * Use a string to represent the name of the table to be joined. |
||
44 | * The table name can contain a schema prefix (e.g. 'public.user') and/or table alias (e.g. 'user u'). |
||
45 | * The method will automatically quote the table name unless it contains some parenthesis |
||
46 | * (which means the table is given as a sub-query or DB expression). |
||
47 | * |
||
48 | * Use an array to represent joining with a sub-query. The array must contain only one element. |
||
49 | * The value must be a [[Query]] object representing the sub-query while the corresponding key |
||
50 | * represents the alias for the sub-query. |
||
51 | * |
||
52 | * @param string|array $on the join condition that should appear in the ON part. |
||
53 | * Please refer to [[join()]] on how to specify this parameter. |
||
54 | * @param array $params the parameters (name => value) to be bound to the query |
||
55 | * @return $this the query object itself |
||
56 | */ |
||
57 | abstract public function leftJoin($table, $on = '', $params = []); |
||
58 | |||
59 | /** |
||
60 | * @param $environment |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function environment($environment) |
||
68 | |||
69 | /** |
||
70 | * Apply environment params |
||
71 | */ |
||
72 | protected function applyEnvironmentConditions() |
||
88 | } |
||
89 |