Note that there are some explanatory texts on larger screens.

plurals
  1. POMapping exception using Stof/Gedmo Translation
    text
    copied!<p>I'm migrating my Symfony 2.0 project to version 2.1rc1. After installing the <code>stof/doctrine-extensions-bundle</code> and the <code>gedmo/doctrine-extensions</code> and test my application I get the following error:</p> <blockquote> <p>No identifier/primary key specified for Entity "Company\TestBundle\Entity\PageTranslation" sub class of "Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation". Every Entity must have an identifier/primary key. </p> </blockquote> <p>My <code>config.yml</code> looks like this:</p> <pre><code># Doctrine Configuration doctrine: dbal: driver: %database_driver% host: %database_host% port: %database_port% dbname: %database_name% user: %database_user% password: %database_password% charset: UTF8 orm: auto_generate_proxy_classes: %kernel.debug% connection: default auto_mapping: true mappings: gedmo_translatable: type: annotation prefix: Gedmo\Translatable\Entity dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity" alias: GedmoTranslatable # this one is optional and will default to the name set for the mapping is_bundle: false gedmo_translator: type: annotation prefix: Gedmo\Translator\Entity dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translator/Entity" alias: GedmoTranslator # this one is optional and will default to the name set for the mapping is_bundle: false stof_doctrine_extensions: default_locale: en translation_fallback: true orm: default: translatable: true sluggable: true </code></pre> <p>According to the <a href="https://github.com/stof/StofDoctrineExtensionsBundle/blob/master/Resources/doc/index.rst" rel="nofollow">documentation of <code>StofDoctrineExtensionsBundle</code></a> this should be fine. The only thing I'm not sure of is the <code>auto_mapping: true</code> option. </p> <p>The only code I've changed in my project is in my <code>CategoryTranslation class</code>. I've replaced:</p> <pre><code>use Stof\DoctrineExtensionsBundle\Entity\AbstractTranslation; </code></pre> <p>by:</p> <pre><code>use Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation; </code></pre> <p>Because the Stof-bundle doesn't have an <code>AbstractTranslation</code> class anymore.</p> <p>Can someone tell me how I can fix this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload