Sylius ProductImage를 번역 할 수있게되어 화가났습니다. 나는 SEO 목적을 위해 ProductImage 이름과 슬러그가 필요하다. 이미 수행 한 어떤Sylius ProductImage 번역 가능하게하기
은 다음과 같습니다 그것에 sylius.model.product_image.class
- 무시 PARAM을 통해 ProductIamge ProductImage.orm.yml의 매핑 파일 & ProductImageTranslation.orm.yml
- 확장 config.yml ,451,515,
ProductImage.orm.yml
AppBundle\Entity\ProductImage:
type: entity
table: sylius_product_image
ProductImageTranslation.orm.yml
AppBundle\Entity\ProductImageTranslation:
type: entity
table: app_product_image_translation
id:
id:
type: integer
generator:
strategy: AUTO
fields:
name:
type: string
nullable: true
slug:
type: string
nullable: true
unique: true
config.yml
sylius_resource:
resources:
app.product_image:
classes:
model: AppBundle\Entity\ProductImage
form: AppBundle\Form\Type\ProductImageType
translation:
classes:
model: AppBundle\Entity\ProductImageTranslation
form: AppBundle\Form\Type\ProductImageTranslationType
결과는 다음 에러이다
An exception occurred while executing 'SELECT t1.type AS type_2, t1.path AS path_3, t1.id AS id_4, t1.owner_id AS owner_id_5 FROM sylius_product_image t1 WHERE t0.owner_id = ?' with params [22]:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.owner_id' in 'where clause'
오류가 조인 변환 테이블이 없기 때문에 발생합니다.
또한 sylius_core에 기본 ProductImage를 오버라이드 (override) 할 필요가
마이그레이션 및/또는 업데이트 된 스키마도 생성 및 적용 했습니까? 'php bin/console doctrine : migration : diff' 또는'php bin/console doctrine : schema : update' – nakashu
예, 번역 결과 테이블을 볼 수 있습니다 :'app_product_image_translation' –