documentation and env changes
This commit is contained in:
@@ -14,15 +14,18 @@ class CatalogResetService
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all reviews and albums from the catalog and returns summary counts.
|
||||
*
|
||||
* @return array{albums:int,reviews:int}
|
||||
*/
|
||||
public function reset(): array
|
||||
public function resetCatalog(): array
|
||||
{
|
||||
$deletedReviews = $this->entityManager->createQuery('DELETE FROM App\Entity\Review r')->execute();
|
||||
|
||||
$albums = $this->albumRepository->findAll();
|
||||
$albumCount = count($albums);
|
||||
foreach ($albums as $album) {
|
||||
// Remove entities one-by-one so Doctrine cascades delete related tracks/reviews as configured.
|
||||
$this->entityManager->remove($album);
|
||||
}
|
||||
$this->entityManager->flush();
|
||||
|
||||
Reference in New Issue
Block a user