Doctrine PHPCR
  1. Doctrine PHPCR
  2. PHPCR-84

make the query API work with child translation strategy

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Labels:
      None

      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).

        Issue Links

          Activity

          Hide
          David Buchmann added a comment -

          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.

          Show
          David Buchmann added a comment - 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.
          Hide
          Lukas Kahwe added a comment -

          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.

          Show
          Lukas Kahwe added a comment - 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.
          Hide
          Lukas Kahwe added a comment -

          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.

          Show
          Lukas Kahwe added a comment - 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.
          Hide
          Lukas Kahwe added a comment -

          if we do this change we should provide a migration script

          Show
          Lukas Kahwe added a comment - if we do this change we should provide a migration script
          Hide
          David Buchmann added a comment -

          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.

          Show
          David Buchmann added a comment - 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.
          Hide
          David Buchmann added a comment -

          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

          Show
          David Buchmann added a comment - 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
          Hide
          Willem-Jan added a comment -

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

          Show
          Willem-Jan added a comment - I started working on the Join issue and will start working on this issue when the Join feature is more or less stable.
          Hide
          Lukas Kahwe added a comment -

          working for attribute strategy

          Show
          Lukas Kahwe added a comment - working for attribute strategy
          Show
          David Buchmann added a comment - https://github.com/doctrine/phpcr-odm/pull/409

            People

            • Assignee:
              Lukas Kahwe
              Reporter:
              Lukas Kahwe
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: