-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
make it easier to query multiple documents without a join #705
Comments
i guess we did not have it because doctrine ORM thinks in database
tables too much. with phpcr-odm it seems a valid use case to support
this, and the resulting query is straightforward
|
Well .. it makes sense when we are using a property to determine the Document class. But when or if we every get around to allowing the PHPCR node type to be used for that purpose then the analogy with the ORM is stronger - would it still make sense? |
could we select from a bunch of different node types in that case or is
that not supported in jcr sql2?
|
You would need to do joins, but I think there is a deeper problem. i.e. above @lsmith77 is selecting from So how would that look with a query builder?
So to start with we have already said the $qb->from(['a', 'b'])->documents([ 'Article', 'Post' ]);
$qb->where()->field('a.tags')->contains('foo');
$qb->orWhere()->field('b.tags')->contains('foo');
$qb->orWhere()->field('a.tags')->contains('bar');
$qb->orWhere()->field('b.tags')->contains('bar'); So we could make |
good point dan. i think if the documents in the original example all share a common ancestor, it would work like this: $qb->from('a')->documents('AppBundle\Document\TaggableContent');
$qb->where()->field('a.tags')->contains('foo'); as the query will not only look for documents of class TaggableContent but also for documents that inherit from TaggableContent. |
Indeed, and using an abstract mapped class as the document source should This is where mixin's come to the rescue in PHPCR (at least |
yeah, ideally we would map traits as mixins and allow to query for traits too. |
Hey, any news on this feature? |
not that i would be aware of. if you want to work on it, please let us know. |
Building a query like the following:
Maybe we could introduce a new method
$from->documents()
to be able to define that the[phpcr:class]
filtering should be done on a set of documents?wdyt @dantleech ?
The text was updated successfully, but these errors were encountered: