sensio/SensioFrameworkExtraBundle — Issue #95: DoctrineParamConverter for OneToOne relations
Author: salessesk
Created: 2012-01-10 10:28:19+00:00
State: open

It might be useful to test if the metadata has an association corresponding to a key in the findOneBy method like this :

``` php
protected function findOneBy($class, Request $request, $options)
{
...
foreach ($request->attributes->all() as $key => $value) {
if ($metadata->hasField($key) || $metadata->hasAssociation($key)) {
$criteria[$key] = $value;
}
}
...
}
```
With that piece of code the DoctrineParamConverter can find an object using his relations.