1 | <?php |
||
21 | class Simple extends \Aimeos\MW\DB\Statement\Base implements \Aimeos\MW\DB\Statement\Iface |
||
22 | { |
||
23 | private $binds = []; |
||
24 | private $parts; |
||
25 | private $sql; |
||
26 | |||
27 | |||
28 | /** |
||
29 | * Initializes the statement object |
||
30 | * |
||
31 | * @param \Aimeos\MW\DB\Connection\PDO $conn Database connection object |
||
32 | * @param string $sql SQL statement |
||
33 | */ |
||
34 | public function __construct( \Aimeos\MW\DB\Connection\PDO $conn, $sql ) |
||
40 | |||
41 | |||
42 | /** |
||
43 | * Binds a value to a parameter in the statement. |
||
44 | * |
||
45 | * @param integer $position Position index of the placeholder |
||
46 | * @param mixed $value Value which should be bound to the placeholder |
||
47 | * @param integer $type Type of given value defined in \Aimeos\MW\DB\Statement\Base as constant |
||
48 | */ |
||
49 | public function bind( $position, $value, $type = \Aimeos\MW\DB\Statement\Base::PARAM_STR ) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * Executes the statement. |
||
77 | * |
||
78 | * @return \Aimeos\MW\DB\Result\Iface Result object |
||
79 | * @throws \Aimeos\MW\DB\Exception If an error occured in the unterlying driver or if the number of binds doesn't match |
||
80 | */ |
||
81 | public function execute() |
||
104 | |||
105 | |||
106 | /** |
||
107 | * Returns the SQL string as sent to the database (magic PHP method) |
||
108 | * |
||
109 | * @return string SQL statement |
||
110 | */ |
||
111 | public function __toString() |
||
119 | |||
120 | |||
121 | /** |
||
122 | * Binds the parameters and executes the SQL statment |
||
123 | * |
||
124 | * @return \Doctrine\DBAL\Driver\Statement Executed DBAL statement |
||
125 | */ |
||
126 | protected function exec() |
||
134 | } |
||
135 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: