Skip to content

Commit d5eb6d6

Browse files
committed
fixed previous commit
1 parent f043906 commit d5eb6d6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Jackalope/Transport/DoctrineDBAL/Client.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,11 @@ public function getNamespaces()
530530
*
531531
* @param $query
532532
* @param array $params
533-
* @param array $types
534533
* @throws DBALException
535534
*/
536-
private function executeUpdate($query, array $params = array(), array $types = array())
535+
private function executeChunkedUpdate($query, array $params)
537536
{
537+
$types = array(Connection::PARAM_INT_ARRAY);
538538
if ($this->conn->getDatabasePlatform() instanceof SqlitePlatform) {
539539
foreach (array_chunk($params, 999) as $chunk) {
540540
$this->conn->executeUpdate($query, array($chunk), $types);
@@ -748,7 +748,7 @@ private function syncReferences()
748748
try {
749749
foreach ($this->referenceTables as $table) {
750750
$query = "DELETE FROM $table WHERE source_id IN (?)";
751-
$this->executeUpdate($query, array(array_keys($toUpdate)), array(Connection::PARAM_INT_ARRAY));
751+
$this->executeChunkedUpdate($query, array_keys($toUpdate));
752752
}
753753
} catch (DBALException $e) {
754754
throw new RepositoryException('Unexpected exception while cleaning up after saving', $e->getCode(), $e);
@@ -784,7 +784,7 @@ private function syncReferences()
784784
// remove all PropertyType::REFERENCE with a source_id on a deleted node
785785
try {
786786
$query = "DELETE FROM phpcr_nodes_references WHERE source_id IN (?)";
787-
$this->executeUpdate($query, array($params), array(Connection::PARAM_INT_ARRAY));
787+
$this->executeChunkedUpdate($query, $params);
788788
} catch (DBALException $e) {
789789
throw new RepositoryException('Unexpected exception while cleaning up deleted nodes', $e->getCode(), $e);
790790
}
@@ -823,7 +823,7 @@ private function syncReferences()
823823
try {
824824
foreach ($this->referenceTables as $table) {
825825
$query = "DELETE FROM $table WHERE target_id IN (?)";
826-
$this->executeUpdate($query, array($params), array(Connection::PARAM_INT_ARRAY));
826+
$this->executeChunkedUpdate($query, $params);
827827
}
828828
} catch (DBALException $e) {
829829
throw new RepositoryException('Unexpected exception while cleaning up deleted nodes', $e->getCode(), $e);

0 commit comments

Comments
 (0)