1 | <?php |
||
27 | class Parameter |
||
28 | { |
||
29 | /** |
||
30 | * parameter pool |
||
31 | * |
||
32 | * @var array |
||
33 | * @access protected |
||
34 | */ |
||
35 | protected $parameters; |
||
36 | |||
37 | /** |
||
38 | * The escape callable |
||
39 | * |
||
40 | * @var callable |
||
41 | * @access protected |
||
42 | */ |
||
43 | protected $escape; |
||
44 | |||
45 | /** |
||
46 | * Returns a replacement placeholder for a $value |
||
47 | * |
||
48 | * @param mixed $value |
||
49 | * @return string |
||
50 | * @access public |
||
51 | */ |
||
52 | public function getPlaceholder($value)/*# : string */ |
||
59 | |||
60 | /** |
||
61 | * Replace placeholders in the SQL with '?' or real value |
||
62 | * |
||
63 | * @param string $sql |
||
64 | * @param array &$bindings |
||
65 | * @param array $settings |
||
66 | * @return string |
||
67 | * @access public |
||
68 | */ |
||
69 | public function bindValues( |
||
86 | |||
87 | /** |
||
88 | * Replace '?' in the string with placeholders for value. |
||
89 | * |
||
90 | * e.q. replace 'RANGE(?, ?)' with values [1, 10] etc. |
||
91 | * |
||
92 | * @param string $string |
||
93 | * @param array $values |
||
94 | * @access public |
||
95 | */ |
||
96 | public function replaceQuestionMark( |
||
107 | |||
108 | /** |
||
109 | * Replace each placeholder with '?', ':name' or value |
||
110 | * |
||
111 | * @param string $key |
||
112 | * @param array &$bindings |
||
113 | * @param array $settings |
||
114 | * @return string |
||
115 | * @access protected |
||
116 | */ |
||
117 | protected function replacePlaceholders( |
||
134 | |||
135 | /** |
||
136 | * Is it a named parameter ? |
||
137 | * |
||
138 | * @param mixed $value |
||
139 | * @return bool |
||
140 | * @access protected |
||
141 | */ |
||
142 | protected function isNamedParam($value)/*# : bool */ |
||
146 | |||
147 | /** |
||
148 | * Set escape/quote method/function |
||
149 | * |
||
150 | * @param null|callable $escapeFunction defult escape function |
||
151 | * @return $this |
||
152 | * @access protected |
||
153 | */ |
||
154 | protected function setEscapeCallable($escapeFunction)/*# : callable */ |
||
169 | } |
||
170 |