Skip to content

Commit

Permalink
Refactor script
Browse files Browse the repository at this point in the history
  • Loading branch information
zkabic committed Oct 6, 2023
1 parent dcde5ca commit 6f639ca
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int

protected function truncateExtra()
{
$this->entityManager->flush();
$sql = "TRUNCATE swp_article_extra RESTART IDENTITY";
$query = $this->entityManager->getConnection()->prepare($sql);
$query->execute();
$this->entityManager->flush();
$this->entityManager->clear();
}

protected function deletePreviousExtra(int $id)
{
$this->entityManager->flush();
$sql = "DELETE FROM swp_article_extra sae WHERE sae.article_id=" . $id;
$query = $this->entityManager->getConnection()->prepare($sql);
$query->execute();
$this->entityManager->flush();
$this->entityManager->clear();
}
}

0 comments on commit 6f639ca

Please sign in to comment.