1 | <?php |
||
31 | abstract class StatementAbstract extends ObjectAbstract implements StatementInterface |
||
32 | { |
||
33 | use SettingsTrait, BuilderAwareTrait; |
||
34 | |||
35 | /** |
||
36 | * value bindings |
||
37 | * |
||
38 | * @var array |
||
39 | * @access protected |
||
40 | */ |
||
41 | protected $bindings; |
||
42 | |||
43 | /** |
||
44 | * Constructor |
||
45 | * |
||
46 | * @param BuilderInterface $builder |
||
47 | * @access public |
||
48 | */ |
||
49 | public function __construct(BuilderInterface $builder) |
||
53 | |||
54 | /** |
||
55 | * {@inheritDoc} |
||
56 | */ |
||
57 | public function getStatement(array $settings = [])/*# : string */ |
||
68 | |||
69 | /** |
||
70 | * {@inheritDoc} |
||
71 | */ |
||
72 | public function getBindings()/*# : array */ |
||
76 | |||
77 | /** |
||
78 | * {@inheritDoc} |
||
79 | */ |
||
80 | public function __toString()/*# : string */ |
||
87 | |||
88 | /** |
||
89 | * Combine builder/statement and provided settings |
||
90 | * |
||
91 | * @param array $settings statement specific settings |
||
92 | * @return array |
||
93 | * @access protected |
||
94 | */ |
||
95 | protected function combineSettings(array $settings)/*# : array */ |
||
104 | |||
105 | /** |
||
106 | * Build SQL statement clauses |
||
107 | * |
||
108 | * @param array $settings |
||
109 | * @param string |
||
110 | * @access protected |
||
111 | */ |
||
112 | protected function buildSql(array $settings)/*# : string */ |
||
122 | |||
123 | /** |
||
124 | * Replace placeholders in the sql with '?', ':named' or real value |
||
125 | * |
||
126 | * @param string $sql |
||
127 | * @param array $settings |
||
128 | * @return string |
||
129 | * @access protected |
||
130 | */ |
||
131 | protected function bindValues(/*# string */ $sql, array $settings) |
||
140 | |||
141 | /** |
||
142 | * Get the statement type, such as 'SELECT' |
||
143 | * |
||
144 | * @return string |
||
145 | * @access protected |
||
146 | */ |
||
147 | protected function getType()/*# : string */ |
||
151 | |||
152 | /** |
||
153 | * Get clause configurations |
||
154 | * |
||
155 | * @return array |
||
156 | * @access protected |
||
157 | */ |
||
158 | protected function getConfigs()/*# : array */ |
||
162 | } |
||
163 |