Selecting nodes based on association doesn't work
- Dominant language
- PHP
- Stars
- 181
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
According to [the documentation](http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/working-with-objects.html#by-simple-conditions) this code should work to select a node based on an association:
``` php
$number = $dm->find('MyProject\Domain\Phonenumber', '/path/to/phone/number');
$user = $dm->getRepository('MyProject\Domain\User')->findOneBy(array('phone' => $number->getUuid()));
```
However, when using this code to get a `MenuNode` documentation with a specific content object, I get an error:
_The code_
``` php
$dm = $this->get('doctrine_phpcr')->getManager();
$contentUuid = $dm->getPhpcrSession()->getItem('/cms/content/home')->getPropertyValue('jcr:uuid');
$dm->getRepository(MenuNode::class)->findOneBy(['content' => $contentUuid]);
```
_The error_
> Cannot use association property "content" of class "...\MenuNode" as a dynamic operand
The docs seem to be incorrect.
More importantly, I can't find a way to select the node. The QueryBuilder can't help with this either.
Contributor guide
Assessment
This issue has not been assessed yet.