Skip to content
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

[2.3+][Form][DoctrineBridge] Improved loading of entities and documents #13997

Merged
merged 1 commit into from
Mar 21, 2015

Conversation

guilhermeblanco
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #13961
License MIT

@@ -99,7 +99,7 @@ class EntityChoiceList extends ObjectChoiceList
* the choices are given as flat array.
* @param PropertyAccessorInterface $propertyAccessor The reflection graph for reading property paths.
*/
public function __construct(ObjectManager $manager, $class, $labelPath = null, EntityLoaderInterface $entityLoader = null, $entities = null, array $preferredEntities = array(), $groupPath = null, PropertyAccessorInterface $propertyAccessor = null)
public function __construct(ObjectManager $manager, $class, $labelPath = null, EntityLoaderInterface $entityLoader, $entities = null, array $preferredEntities = array(), $groupPath = null, PropertyAccessorInterface $propertyAccessor = null)
Copy link
Contributor

Choose a reason for hiding this comment

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

So not to break BC, would it make sense to leave $entityLoader is nullable and construct one using the required $manager and $class arguments?

$this->entityLoader = ($entityLoader !== null)
    ? $entityLoader
    : $manager->getRepository($class)->createQueryBuilder('e');

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, never mind. This would only create a query builder -- not an EntityLoader implementation.

@fabpot
Copy link
Member

fabpot commented Mar 21, 2015

Thank you @guilhermeblanco.

@fabpot fabpot merged commit 529d99c into symfony:2.3 Mar 21, 2015
fabpot added a commit that referenced this pull request Mar 21, 2015
…and documents (guilhermeblanco)

This PR was merged into the 2.3 branch.

Discussion
----------

[2.3+][Form][DoctrineBridge] Improved loading of entities and documents

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13961
| License       | MIT

Commits
-------

529d99c Fixed MongoODM entity loader. Improved loading behavior of entities and documents by reusing entity loader.
@guilhermeblanco guilhermeblanco deleted the entity-loader-fix branch March 22, 2015 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants