1 | <?php |
||
2 | |||
3 | namespace GeekLab\GLPDO2\Bindings; |
||
4 | |||
5 | use PDO; |
||
6 | use Exception; |
||
7 | use JsonException; |
||
8 | |||
9 | interface StringBindingInterface |
||
10 | { |
||
11 | /** |
||
12 | * Bind an object or JSON string to a string. |
||
13 | * |
||
14 | * @param mixed $value |
||
15 | * @param bool $null |
||
16 | * |
||
17 | * @return array{string, int} |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
18 | * @throws JsonException |
||
19 | */ |
||
20 | public function bJSON(mixed $value, bool $null = false): array; |
||
21 | |||
22 | /** |
||
23 | * Create and bind string for LIKE() statements. |
||
24 | * |
||
25 | * @param string $value |
||
26 | * @param bool $ends Ends with? |
||
27 | * @param bool $starts Starts with? |
||
28 | * |
||
29 | * @return array{string} |
||
0 ignored issues
–
show
|
|||
30 | */ |
||
31 | public function bLike(string $value, bool $ends = false, bool $starts = false): array; |
||
32 | |||
33 | /** |
||
34 | * Bind a string value. |
||
35 | * |
||
36 | * @param float | bool | int | string | null $value |
||
37 | * @param bool $null |
||
38 | * @param int $type |
||
39 | * |
||
40 | * @return array{string, int} |
||
0 ignored issues
–
show
|
|||
41 | * @throws Exception |
||
42 | */ |
||
43 | public function bStr( |
||
44 | float | bool | int | string | null $value, |
||
45 | bool $null = false, |
||
46 | int $type = PDO::PARAM_STR |
||
47 | ): array; |
||
48 | |||
49 | /** |
||
50 | * Convert an array into a string and bind it. |
||
51 | * Great for IN() statements. |
||
52 | * |
||
53 | * @param array{} | array{mixed} $values |
||
0 ignored issues
–
show
|
|||
54 | * @param float | bool | int | string $default |
||
55 | * |
||
56 | * @return array{float | bool | int | string} |
||
0 ignored issues
–
show
|
|||
57 | */ |
||
58 | public function bStrArr(array $values, float | bool | int | string $default = ''): array; |
||
59 | } |
||
60 |