Symfony2.0プロジェクトをバージョン2.1rc1に移行しています。stof/doctrine-extensions-bundle
およびをインストールしgedmo/doctrine-extensions
てアプリケーションをテストした後、次のエラーが発生します。
「Gedmo\Translatable \ Entity \ MappedSuperclass\AbstractTranslation」のエンティティ「Company\TestBundle \ Entity\PageTranslation」サブクラスに識別子/主キーが指定されていません。すべてのエンティティには、識別子/主キーが必要です。
私config.yml
はこのように見えます:
# 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
これのドキュメントにStofDoctrineExtensionsBundle
よると、問題ないはずです。私が確信していない唯一のことはauto_mapping: true
オプションです。
私のプロジェクトで変更した唯一のコードは私のにありCategoryTranslation class
ます。私は交換しました:
use Stof\DoctrineExtensionsBundle\Entity\AbstractTranslation;
に:
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation;
StofバンドルにはAbstractTranslation
もうクラスがないからです。
誰かが私がこれを修正する方法を教えてもらえますか?