Problem polega na tym ze nie moge uzywa dotakowych repozytoriow ani encji.
Wiec takie rozwiazanie odpada:
- https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/translatable.md#translation-entity
- https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/translatable.md#personal-translations
Poki co probowalem tak:
/** * Cleans texts of of the content with given ID * * @param integer $contentId ID of the content * @return boolean */ public function cleanContent($contentId) { $content = $this->getContentById($contentId); if ($content !== null) { $translations = $this->getEntityManager() ->getRepository('Gedmo\Translatable\Entity\Translation') 'objectClass' => $this->getEntityClassName(), 'content' => $content->getContent() ) ); foreach ($translations as $translation) { $this->getEntityManager()->remove($translation); } $content->setContent(null); $this->getEntityManager()->flush(); return true; } return false; }
W translations znajduje sie:
Kod
Array ( [0] => Gedmo\Translatable\Entity\Translation Object ( [id:protected] => 1 [locale:protected] => pl_PL [objectClass:protected] => Meritoo\Cmf\PagesContentBundle\Entity\PagesContent [field:protected] => title [foreignKey:protected] => 1 [content:protected] => Strona główna ) [1] => Gedmo\Translatable\Entity\Translation Object ( [id:protected] => 3 [locale:protected] => en_GB [objectClass:protected] => Meritoo\Cmf\PagesContentBundle\Entity\PagesContent [field:protected] => title [foreignKey:protected] => 1 [content:protected] => Strona główna ) [2] => Gedmo\Translatable\Entity\Translation Object ( [id:protected] => 5 [locale:protected] => de_DE [objectClass:protected] => Meritoo\Cmf\PagesContentBundle\Entity\PagesContent [field:protected] => title [foreignKey:protected] => 1 [content:protected] => Strona główna ) [3] => Gedmo\Translatable\Entity\Translation Object ( [id:protected] => 7 [locale:protected] => fr_FR [objectClass:protected] => Meritoo\Cmf\PagesContentBundle\Entity\PagesContent [field:protected] => title [foreignKey:protected] => 1 [content:protected] => Strona główna ) [4] => Gedmo\Translatable\Entity\Translation Object ( [id:protected] => 9 [locale:protected] => en_US [objectClass:protected] => Meritoo\Cmf\PagesContentBundle\Entity\PagesContent [field:protected] => title [foreignKey:protected] => 1 [content:protected] => Strona główna ) )
Czyli mamy encje Translation wiec dlaczego remove nie dziala?
Zero bledow kompletnie nic a w bazie tlumaczenia dalej sa.
Czy ktos wie jak rozwiazac problem?