Skip to content

Commit

Permalink
Add support for Doctrine DBAL 4 and ORM 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher committed Nov 13, 2023
1 parent df22a93 commit 499e964
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
"homepage": "https://github.com/sonata-project/sonata-doctrine-extensions",
"require": {
"php": "^8.0",
"doctrine/dbal": "^3.4",
"doctrine/dbal": "^3.4 || ^4.0",
"doctrine/persistence": "^3.0.2"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.7",
"doctrine/doctrine-bundle": "^2.10",
"doctrine/event-manager": "^1.2 || ^2.0",
"doctrine/mongodb-odm": "^2.4",
"doctrine/orm": "^2.14",
"doctrine/orm": "^2.16 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.4",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.2.1",
Expand All @@ -50,7 +50,7 @@
"conflict": {
"doctrine/doctrine-bundle": "<2.7",
"doctrine/mongodb-odm": "<2.4",
"doctrine/orm": "<2.14"
"doctrine/orm": "<2.16"
},
"suggest": {
"doctrine/mongodb-odm": "If you use mongo",
Expand Down
1 change: 1 addition & 0 deletions tests/App/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
$container->loadFromExtension('doctrine', [
'dbal' => ['url' => 'sqlite://:memory:'],
'orm' => [
'report_fields_where_declared' => true,
'mappings' => [
'Entity' => [
'type' => 'attribute',
Expand Down
4 changes: 2 additions & 2 deletions tests/Mapper/DoctrineCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sonata\Doctrine\Tests\Mapper;

use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use PHPUnit\Framework\TestCase;
use Sonata\Doctrine\Mapper\Builder\ColumnDefinitionBuilder;
use Sonata\Doctrine\Mapper\Builder\OptionsBuilder;
Expand Down Expand Up @@ -46,7 +46,7 @@ public function testClear(): void
$collector = DoctrineCollector::getInstance();
$collector->addIndex(\stdClass::class, 'name', ['column']);
$collector->addUnique(\stdClass::class, 'name', ['column']);
$collector->addInheritanceType(\stdClass::class, ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE);
$collector->addInheritanceType(\stdClass::class, ClassMetadata::INHERITANCE_TYPE_SINGLE_TABLE);
$collector->addDiscriminatorColumn(\stdClass::class, ColumnDefinitionBuilder::create()
->add('columnDef', ''));
$collector->addAssociation(\stdClass::class, 'type', OptionsBuilder::createOneToOne('foo', 'bar')
Expand Down
4 changes: 2 additions & 2 deletions tests/Mapper/ORM/DoctrineORMMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sonata\Doctrine\Tests\Mapper\ORM;

use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Sonata\Doctrine\Mapper\Builder\ColumnDefinitionBuilder;
use Sonata\Doctrine\Mapper\Builder\OptionsBuilder;
use Sonata\Doctrine\Mapper\DoctrineCollector;
Expand Down Expand Up @@ -43,7 +43,7 @@ public static function setUpBeforeClass(): void

$collector->addDiscriminator(TestEntity::class, 'test', TestInheritanceEntity::class);
$collector->addDiscriminatorColumn(TestEntity::class, $columnDefinition);
$collector->addInheritanceType(TestEntity::class, ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE);
$collector->addInheritanceType(TestEntity::class, ClassMetadata::INHERITANCE_TYPE_SINGLE_TABLE);
$collector->addAssociation(TestEntity::class, 'mapManyToOne', $options);
$collector->addOverride(TestEntity::class, 'setAttributeOverride', $override);
}
Expand Down

0 comments on commit 499e964

Please sign in to comment.