Exactly, imho that is what makes most sense. Same as find() before you update a document, rather than just persist new obj with existing id.

I think that should be doable for applications and is so much cleaner. Avoids the merge or accidental overwrite of some field translations.

----- Reply message -----
Von: "dantleech" <notifications@github.com>
An: "doctrine/phpcr-odm" <phpcr-odm@noreply.github.com>
Cc: "David Buchmann" <david@liip.ch>
Betreff: [phpcr-odm] Allow retrieval of non-flushed document translations. (#375)
Datum: Sa., Dez. 7, 2013 09:20
In lib/Doctrine/ODM/PHPCR/UnitOfWork.php: 
> +     * 
> +     * @see doLoadTranslation 
> +     */ 
> +    protected function doLoadPendingTranslation($document, ClassMetadata $metadata, $locale) 
> +    { 
> +        $oid = spl_object_hash($document); 
> + 
> +        if (!isset($this->documentTranslations[$oid][$locale])) { 
> +            return false; 
> +        } 
> + 
> +        $currentLocale = $this->getCurrentLocale($document, $metadata); 
> + 
> +        if ($currentLocale == $locale) { 
> +            throw new \RuntimeException(sprintf( 
> +                'Cannot load translations for "%s" because there are already staged changes for this locale.', 

hmm.. I am having difficulty understanding all of this generally. 


If we attempt to bind a translation which already exists in memory or in storage, there is something wrong 


So does that mean if you want to update a translation in several languages from the request you need to perform first a "findTranslation" for each? 

&mdash;
Reply to this email directly or view it on GitHub.