File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,12 +154,13 @@ public function update(ProductCommentCriterion $criterion): int
154154 private function updateCategories ($ criterion ): int
155155 {
156156 $ res = 0 ;
157- $ criterionId = $ criterion ->getId ();
157+ $ criterionId = ( int ) $ criterion ->getId ();
158158 foreach ($ criterion ->getCategories () as $ id_category ) {
159159 $ res += $ this ->connection ->executeUpdate (
160160 'INSERT INTO ` ' .
161161 _DB_PREFIX_ . 'product_comment_criterion_category` (`id_product_comment_criterion`, `id_category`)
162- VALUES( ' . $ criterionId . ', ' . $ id_category . ') '
162+ VALUES(?, ?) ' ,
163+ [$ criterionId , (int ) $ id_category ]
163164 );
164165 }
165166
@@ -169,12 +170,13 @@ private function updateCategories($criterion): int
169170 private function updateProducts ($ criterion ): int
170171 {
171172 $ res = 0 ;
172- $ criterionId = $ criterion ->getId ();
173+ $ criterionId = ( int ) $ criterion ->getId ();
173174 foreach ($ criterion ->getProducts () as $ id_product ) {
174175 $ res += $ this ->connection ->executeUpdate (
175176 'INSERT INTO ` ' .
176177 _DB_PREFIX_ . 'product_comment_criterion_product` (`id_product_comment_criterion`, `id_product`)
177- VALUES( ' . $ criterionId . ', ' . $ id_product . ') '
178+ VALUES(?, ?) ' ,
179+ [$ criterionId , (int ) $ id_product ]
178180 );
179181 }
180182
You can’t perform that action at this time.
0 commit comments