diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 56615807f4e..c0b0dd8c302 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1154,11 +1154,7 @@ private function getCommitOrder(array $entityChangeSet = null) $joinColumns = reset($assoc['joinColumns']); - $calc->addDependency( - $targetClass->name, - $class->name, - (int) (($joinColumns['nullable'] ?? true) === false) - ); + $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable'])); // If the target class has mapped subclasses, these share the same dependency. if ( ! $targetClass->subClasses) { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6499Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6499Test.php deleted file mode 100644 index 0d86fffb037..00000000000 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6499Test.php +++ /dev/null @@ -1,96 +0,0 @@ -_schemaTool->createSchema([ - $this->_em->getClassMetadata(DDC6499A::class), - $this->_em->getClassMetadata(DDC6499B::class), - ]); - } - - /** - * {@inheritDoc} - */ - protected function tearDown() : void - { - parent::tearDown(); - - $this->_schemaTool->dropSchema([ - $this->_em->getClassMetadata(DDC6499A::class), - $this->_em->getClassMetadata(DDC6499B::class), - ]); - } - - public function testIssue() : void - { - $b = new DDC6499B(); - $a = new DDC6499A(); - - $this->_em->persist($a); - - $a->b = $b; - - $this->_em->persist($b); - - $this->_em->flush(); - - self::assertInternalType('integer', $a->id); - self::assertInternalType('integer', $b->id); - } - - public function testIssueReversed() : void - { - $b = new DDC6499B(); - $a = new DDC6499A(); - - $a->b = $b; - - $this->_em->persist($b); - $this->_em->persist($a); - - $this->_em->flush(); - - self::assertInternalType('integer', $a->id); - self::assertInternalType('integer', $b->id); - } -} - -/** @Entity */ -class DDC6499A -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** @JoinColumn(nullable=false) @OneToOne(targetEntity=DDC6499B::class) */ - public $b; -} - -/** @Entity */ -class DDC6499B -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** @ManyToOne(targetEntity="DDC6499A") */ - private $a; -}