Browse Source

Merge branch 'develop'

develop
Guillaume 3 years ago
parent
commit
732ad82a0c
2 changed files with 6 additions and 2 deletions
  1. +6
    -1
      Controller/AbstractAdminController.php
  2. +0
    -1
      Repository/Site/NewsStore.php

+ 6
- 1
Controller/AbstractAdminController.php View File



public function deleteEntity(EntityManagerInterface $entityManager, $entityInstance): void public function deleteEntity(EntityManagerInterface $entityManager, $entityInstance): void
{ {
$entityManager->delete($entityInstance);
if($this->isInstanceOf(StatusInterface::class)){
$entityInstance->setStatus(-1);
$entityManager->update($entityInstance);
}else{
$entityManager->delete($entityInstance);
}
$entityManager->flush(); $entityManager->flush();
$this->get(FlashBagTranslator::class)->add('success', 'deleted', $this->getTranslationEntityName()); $this->get(FlashBagTranslator::class)->add('success', 'deleted', $this->getTranslationEntityName());
} }

+ 0
- 1
Repository/Site/NewsStore.php View File



public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{ {
$query->orderBy('id');
return $query; return $query;
} }



Loading…
Cancel
Save