8000 [DoctrineBridge] try to fix deprecations from doctrine/persistence by nicolas-grekas · Pull Request #34949 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DoctrineBridge] try to fix deprecations from doctrine/persistence #34949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

nicolas-grekas
Copy link
Member
@nicolas-grekas nicolas-grekas commented Dec 12, 2019
Q A
Branch? 3.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Follows doctrine/persistence#71
But the BC layer is not working yet, as highlighted by the XXX in the attached patch.
At least for the corresponding interfaces, doctrine/persistence should always alias the legacy name to the new one. already the case.

/cc @greg0ire @alcaeus FYI

@@ -51,7 +51,7 @@ public function configureOptions(OptionsResolver $resolver)
*
8000 * @return ORMQueryBuilderLoader
*/
public function getLoader(ObjectManager $manager, $queryBuilder, $class)
public function getLoader(LegacyObjectManager $manager, $queryBuilder, $class)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing the type would be a BC break

@@ -22,7 +22,7 @@
*
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
*/
abstract class ManagerRegistry extends AbstractManagerRegistry implements ContainerAwareInterface
abstract class ManagerRegistry extends LegacyAbstractManagerRegistry implements ContainerAwareInterface
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing the type would be a BC break

use Doctrine\ORM\EntityManager;

/**
* References Doctrine connections and entity managers.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface RegistryInterface extends ManagerRegistryInterface
interface RegistryInterface extends LegacyManagerRegistry
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing the type would be a BC break

@@ -40,15 +41,15 @@ public function getRepository(EntityManagerInterface $entityManager, $entityName
return $this->repositoryList[$repositoryHash] = $this->createRepository($entityManager, $entityName);
}

public function setRepository(EntityManagerInterface $entityManager, $entityName, ObjectRepository $repository)
public function setRepository(EntityManagerInterface $entityManager, $entityName, LegacyObjectRepository $repository)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing the type would be a BC break

@@ -25,7 +25,7 @@ public function setContainer(ContainerInterface $container = null)
$this->container = $container;
}

public function load(ObjectManager $manager)
public function load(LegacyObjectManager $manager)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing the type would be a BC break

@@ -273,7 +277,7 @@ public function configureOptions(OptionsResolver $resolver)
*
* @return EntityLoaderInterface
*/
abstract public function getLoader(ObjectManager $manager, $queryBuilder, $class);
abstract public function getLoader(LegacyObjectManager $manager, $queryBuilder, $class);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing the type would be a BC break

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it really? It's a class alias, so they are the same thing, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not when v1.2 is checked out

nicolas-grekas added a commit that referenced this pull request Dec 12, 2019
…ersistence (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[DoctrineBridge] try to fix deprecations from doctrine/persistence

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Follows doctrine/persistence#71
But the BC layer is not working yet, as highlighted by the `XXX` in the attached patch.
At least for the corresponding interfaces, doctrine/persistence should always alias the legacy name to the new one.

/cc @greg0ire @alcaeus FYI

Commits
-------

53a4711 [DoctrineBridge] try to fix deprecations from doctrine/persistence
@nicolas-grekas nicolas-grekas merged commit 53a4711 into symfony:3.4 Dec 12, 2019
@nicolas-grekas nicolas-grekas deleted the doctrine-persistence branch December 12, 2019 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0