mark-gerarts / mark-gerarts/automapper-plus
Proxies with Doctrine
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 562
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
Hi !
When we use Doctrine wich returns proxies, the mapper could not map : it maps property to null.
Is there a solution ?
example dump doctrine result :
```
App\Entity\Company {#584
-id: 81
-secteur: Proxies\__CG__\App\Entity\Secteur {
-id: 1
-name: null
}
```
`dump($company->getSecteur->getName())` : returns a string
but the mapper found "null"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the mapping with the Doctrine proxy example in the issue, then trace how the mapper reads the proxied secteur property. Add a regression test covering the proxy and verify that the mapped name is not null when the getter returns a string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100