1 | <?php |
||
23 | trait QueryTrait |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * Attach like condition. |
||
28 | * @param mixed $value |
||
29 | * @param string $attribute |
||
30 | * @param string|false $like |
||
31 | * @return $this |
||
32 | */ |
||
33 | 21 | protected function likeCondition($value, $attribute, $like = false) |
|
43 | |||
44 | /** |
||
45 | * Specify range wilth $attribute to $query. |
||
46 | * @param ActiveQuery $query |
||
47 | * @param string $attribute |
||
48 | * @param string $start |
||
49 | * @param string $end |
||
50 | * @return $query |
||
51 | */ |
||
52 | 1 | protected static function range($query, $attribute, $start = null, $end = null) |
|
62 | } |
||
63 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: