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