Symfony 2.0 프로젝트를 버전 2.1rc1로 마이그레이션하려고합니다. 이 괜찮을해야 documentation of StofDoctrineExtensionsBundle
에 따르면Stof/Gedmo Translation을 사용한 매핑 예외
# 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
:
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.
내 config.yml
은 다음과 같습니다 : 내 응용 프로그램을 stof/doctrine-extensions-bundle
과 gedmo/doctrine-extensions
를 설치하고 테스트 한 후 나는 다음과 같은 오류가 발생합니다. 내가 확신 할 수없는 유일한 점은 auto_mapping: true
옵션입니다.
내 프로젝트에서 변경 한 유일한 코드는 내 CategoryTranslation class
입니다. 나는 대체했습니다
use Stof\DoctrineExtensionsBundle\Entity\AbstractTranslation;
기준 :
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation;
Stof - 번들이 더이상 AbstractTranslation
클래스가 없기 때문에.
누군가 내가 이것을 고칠 수있는 방법을 말해 줄 수 있습니까?
확인 아무것도 생성 할 수 있도록 분명히 내 번역 기관도 처리되고있는 필요가 없습니다 : 생성 : 명령 줄에서 개체 합니다. 어떻게 이런 일이 일어나지 않도록 매핑을 설정합니까? – Rick
PageTranslation 클래스/매핑을 추가하십시오. – AdrienBrault