$assocProductsStmt->
execute([':categoryID' =>
$originalCategoryId]);
$products =
$assocProductsStmt->
fetchAll(PDO::FETCH_COLUMN, 0
);
if ($products) { $this->connection->
query( 'INSERT INTO s_articles_categories (categoryID, articleID)
VALUES (' .
$newCategoryId . ', ' .
implode('), (' .
$newCategoryId . ', ',
$products) . ')'
);
foreach ($products as $productId) { $this->categoryDenormalization->
addAssignment((int) $productId,
$newCategoryId);
} } } /**
* Rebuilds the path for a single category
*
* @param int $categoryId
* @param string $categoryPath
*
* @return int
*/