私はSylius ProductImageを翻訳可能にするのに怒っています。私はSEOの目的のためにProductImageの名前とスラッグが必要です。私はすでにやったSyliusをProductImageに翻訳可能にする
は次のようになります。それにsylius.model.product_image.class
- オーバーライドPARAM経由ProductIamge ProductImage.orm.ymlのマッピングファイル& ProductImageTranslation.orm.yml
- 拡張config.yml
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をオーバーライドする必要が
移行/更新スキーマを生成して適用しましたか? 'php bin/console doctrine:migration:diff'または' php bin/console doctrine:schema:update' – nakashu
はい、私は結果の変換テーブルを見ることができます: 'app_product_image_translation' –