1 | <?php |
||
20 | class Simple extends \Aimeos\MW\DB\Statement\Base implements \Aimeos\MW\DB\Statement\Iface |
||
21 | { |
||
22 | private $binds = []; |
||
23 | private $parts; |
||
24 | private $sql; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Initializes the statement object |
||
29 | * |
||
30 | * @param \Aimeos\MW\DB\Connection\DBAL $conn Database connection object |
||
31 | * @param string $sql SQL statement |
||
32 | */ |
||
33 | public function __construct( \Aimeos\MW\DB\Connection\DBAL $conn, $sql ) |
||
39 | |||
40 | |||
41 | /** |
||
42 | * Binds a value to a parameter in the statement. |
||
43 | * |
||
44 | * @param integer $position Position index of the placeholder |
||
45 | * @param mixed $value Value which should be bound to the placeholder |
||
46 | * @param integer $type Type of given value defined in \Aimeos\MW\DB\Statement\Base as constant |
||
47 | */ |
||
48 | public function bind( $position, $value, $type = \Aimeos\MW\DB\Statement\Base::PARAM_STR ) |
||
72 | |||
73 | |||
74 | /** |
||
75 | * Executes the statement. |
||
76 | * |
||
77 | * @return \Aimeos\MW\DB\Result\Iface Result object |
||
78 | * @throws \Aimeos\MW\DB\Exception If an error occured in the unterlying driver or if the number of binds doesn't match |
||
79 | */ |
||
80 | public function execute() |
||
103 | |||
104 | |||
105 | /** |
||
106 | * Returns the SQL string as sent to the database (magic PHP method) |
||
107 | * |
||
108 | * @return string SQL statement |
||
|
|||
109 | */ |
||
110 | public function __toString() |
||
118 | |||
119 | |||
120 | /** |
||
121 | * Binds the parameters and executes the SQL statment |
||
122 | * |
||
123 | * @return \Doctrine\DBAL\Driver\Statement Executed DBAL statement |
||
124 | */ |
||
125 | protected function exec() |
||
133 | } |
||
134 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.