0

I'm using Doctrine PHPCR for a project. And I have relationships between many classes:

class B
{
    /** @Referrers(targetDocument="b") */
    private $a;
}    

class A
{
    /** ReferenceOne(targetDocument="a") */
    private $b;
    private $c;
}

class C 
{
    /** @Referrers(targetDocument="c") */
    private $a;
}

With this relation how I can do a multiple join:

If I use $queryBuilder->addJoinInner twice give me error: Join with Joins in a NotImplementException. I need all b data in my database with an given c instance

2 Answers2

2

BTW to learn what is possible with SQL2 have a look at the grammar: http://www.h2database.com/jcr/grammar.html

1

You can look into JCR SQL2 and do the join yourself. Use DocumentManager::createPhpcrQuery and then DocumentManager::getDocumentsByPhpcrQuery to get documents with that query.

Or you could try to implement multiple joins with the QueryBuilder - pull requests would be very welcome.

dbu
  • 1,497
  • 9
  • 8