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

Deprecate getParentFieldDescription from ModelManagerInterface #6234

Merged
merged 1 commit into from
Jul 27, 2020

Conversation

franmomu
Copy link
Member

Subject

Taking a look at the method ModelManager::getParentFieldDescription() from SonataDoctrineMongoDBAdminBundle (and the one in SonataDoctrineORMBundle), looks like they are not used anymore, in fact, the first parameter they receive ($parentAssociationMapping) is an array and then there is this code (which would fail because of using an array as a key):

$associatingMapping = $metadata->associationMappings[$parentAssociationMapping];

This method was added in b0df44f, and the $parentAssociationMapping parameter back then was a string. There was this call in the AbstractAdmin class (previously known as Admin):

$fieldDescription = $this->getModelManager()->getParentFieldDescription($this->getParentAssociationMapping(), $this->getClass());

Then in 789802d that call was replaced by calling to the getParentFieldDescription within the Admin class.

There are maybe other uses of this method I haven't found, but looks like this method is not used.

I am targeting this branch, because these changes are BC.

Changelog

### Deprecated
- Deprecated `ModelManagerInterface::getParentFieldDescription`.

@franmomu franmomu added the minor label Jul 27, 2020
@VincentLanglet
Copy link
Member

We should make PR on storages bundle to remove this method too.

@jordisala1991 jordisala1991 merged commit baca9f4 into sonata-project:3.x Jul 27, 2020
@jordisala1991
Copy link
Member

Thank you @franmomu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants