[PHPCR-84] make the query API work with child translation strategy Created: 23/Oct/12  Updated: 15/Feb/14  Resolved: 15/Feb/14

Status: Closed
Project: Doctrine PHPCR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Lukas Kahwe Assignee: Lukas Kahwe
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Dependency
depends on PHPCR-92 Join support in QueryBuilder Closed

 Description   

when searching there must be some way to ensure that for translateable documents the right fields are filters. f.e. when using the child strategy then for the given columns the node name needs to be checked (nodename = phpcr_locale:fr).



 Comments   
Comment by David Buchmann [ 23/Oct/12 ]

sounds like asking for a PHPCR-ODM DQL , then we could handle this perfectly transparent. as an intermediate, a method to build the criterion for a field of a mapped entity would be the right way i think. you could even do that for non-multilang in case you mapped the documents field to some differently named PHPCR property.

Comment by Lukas Kahwe [ 24/Oct/12 ]

here is an example where i manually handle this:
https://github.com/symfony-cmf/SearchBundle/blob/master/Controller/PhpcrSearchController.php

if we were to do it automatically we might not need our own DQL, we could do a QOMWalker. however i doubt that we can fully automate this, since everything can be mixed. ie. one path can have any number of different strategies.

Comment by Lukas Kahwe [ 24/Oct/12 ]

btw .. it might make sense to always namespace the property names, even when using the child translation strategy. this could make it easier to deal with searching across mixed translation strategies.

Comment by Lukas Kahwe [ 11/Jan/13 ]

if we do this change we should provide a migration script

Comment by David Buchmann [ 25/Mar/13 ]

it gets even worse when translated and non-translated documents get mixed up. see for example the cmf sandbox menu admin (not multilang menu). it mixes translated and non-translated documents. since https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/pull/100 you can sort on columns, so sorting will half work half not.

Comment by David Buchmann [ 13/May/13 ]

there seem to be other solutions like descendant, but if we had join in jackalope-doctrine-dbal that could be a good option https://github.com/jackalope/jackalope-doctrine-dbal/issues/15

Comment by Willem-Jan [ 14/May/13 ]

I started working on the Join issue and will start working on this issue when the Join feature is more or less stable.

Comment by Lukas Kahwe [ 06/Oct/13 ]

working for attribute strategy

Comment by David Buchmann [ 15/Feb/14 ]

https://github.com/doctrine/phpcr-odm/pull/409

Generated at Sat Nov 22 15:41:25 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.