Menu
  • HOME
  • TAGS

Why tree is invalid?

symfony2,doctrine2,tree,doctrine-extensions,stofdoctrineextensions

I found problem, when i delete a entity by $em->remove method, doctrine extension assume that onDelete=cascade for entity & change lft & rgt values of tree, then run query for removing of entity(and all children), but my entity have onDelete=restrict, then lft & rgt values are updated, but children is...

DoctrineExtensions translatable in ZF2 - how and where can I setDefaultLocale

php,zend-framework2,locale,doctrine-extensions

So my mistake was, that I configured the TranslatableListener twice. In my doctrine configuration (only for explanation there is a comment before, delete the whole line): 'doctrine' => [ 'eventmanager' => [ 'orm_default' => [ 'subscribers' => [ 'Gedmo\Timestampable\TimestampableListener', 'Gedmo\Sluggable\SluggableListener', // 'Gedmo\Translatable\TranslatableListener', ], ], ], and in bootstrap: // sets...

Use loggable to refer to a version of Product in Order Line?

php,symfony2,doctrine2,doctrine-extensions,stofdoctrineextensions

You can implement this function in your Repository to get current/last version public function getCurrentVersion($id) { $repo = $this->_em->getRepository('Gedmo\Loggable\Entity\LogEntry'); $log = $repo->findOneBy(array('objectId' =>$id), array('version' => 'desc')); return $log ? $log->getVersion() : null; // or return $log for entire object } ...

translation-form with default entity translations not found

php,symfony2,doctrine-extensions

Here is the working example from my current project how to use DoctrineExtension from KNP (I know this doesn't answer the question, look at the comments above). composer.json: "knplabs/doctrine-behaviors": "dev-master", "a2lix/translation-form-bundle" : "dev-master" config.yml: imports: ... - { resource: ../../vendor/knplabs/doctrine-behaviors/config/orm-services.yml } framework: translator: fallback: "%locale%" ... a2lix_translation_form: locale_provider: default locales:...

Doctrine behavioral extensions: Loggable with Timestampable

symfony2,doctrine,doctrine-extensions

https://github.com/l3pp4rd/DoctrineExtensions/blob/master/lib/Gedmo/Loggable/Entity/MappedSuperclass/AbstractLogEntry.php#L35 Is loggedAt property an answer for your question?...

Symfony 2.3 Gedmo doctrine extensions translatable caching

php,symfony2,caching,doctrine2,doctrine-extensions

Our working code: public function addTranslationWalkerToQuery($query, $request) { $config = $this->container->get('doctrine')->getManager()->getConfiguration(); if ($config->getCustomHydrationMode(TranslationWalker::HYDRATE_OBJECT_TRANSLATION) === null) { $config->addCustomHydrationMode( TranslationWalker::HYDRATE_OBJECT_TRANSLATION, 'Gedmo\\Translatable\\Hydrator\\ORM\\ObjectHydrator' ); } $query->setHint( \Doctrine\ORM\Query::HINT_CUSTOM_OUTPUT_WALKER,...