Skip to content

Commit

Permalink
Add Doctrine DBAL v4 / ORM v3 support, remove DBAL v2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
hlecorche committed Nov 16, 2024
1 parent 70206c2 commit c3551f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"ext-json": "*",
"ext-mbstring": "*",
"doctrine/collections": "^1.5|^2.0",
"doctrine/dbal": "^2.13.1|^3.2",
"doctrine/dbal": "^3.2|^4.0",
"doctrine/doctrine-bundle": "^2.4.5",
"doctrine/orm": "^2.9",
"doctrine/orm": "^2.9|^3.0",
"doctrine/persistence": "^1.3|^2.0|^3.0",
"ecommit/doctrine-utils": "^1.0",
"ecommit/doctrine-utils": "^1.0|^2.0",
"ecommit/paginator": "^1.0",
"ecommit/scalar-values": "^1.0",
"psr/container": "^1.1|^2.0",
Expand Down
5 changes: 3 additions & 2 deletions src/Crud/Crud.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ protected function resetDisplaySettings(): void
if ($this->options['persistent_settings']) {
// Remove settings in database
$qb = $this->container->get('doctrine')->getManager()->createQueryBuilder();
$qb->delete('EcommitCrudBundle:UserCrudSettings', 's')
$qb->delete(UserCrudSettings::class, 's')
->andWhere('s.user = :user AND s.crudName = :crud_name')
->setParameters(['user' => $this->container->get('security.token_storage')->getToken()->getUser(), 'crud_name' => $this->getSessionName()])
->setParameter('user', $this->container->get('security.token_storage')->getToken()->getUser())
->setParameter('crud_name', $this->getSessionName())
->getQuery()
->execute();
}
Expand Down
3 changes: 2 additions & 1 deletion src/EventListener/MappingEntities.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Ecommit\CrudBundle\EventListener;

use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataInfo;

final class MappingEntities
Expand Down Expand Up @@ -43,7 +44,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void
}
}

protected function mappUserCrudSettings(ClassMetadataInfo $userCrudSettingsMetadata, ClassMetadataInfo $userMetadata): void
protected function mappUserCrudSettings(ClassMetadataInfo|ClassMetadata $userCrudSettingsMetadata, ClassMetadataInfo|ClassMetadata $userMetadata): void
{
$this->isLoad = true;

Expand Down

0 comments on commit c3551f1

Please sign in to comment.