私はSyliusを新しくしました。私はRest APIを使用しています。 私の質問:ファイルをより多く公開するためにファイルをシリアライズする方法をオーバーライドするにはどうすればよいですか?例えば :Sylius:シリアライザ設定 "Model.Product.yml"をオーバーライドしてより多くのファイルを公開する
ベンダー/ sylius/sylius/SRC/Sylius /バンドル/ ProductBundle /リソース/設定/シリアライザ/ Model.Product.yml
私が原型と翻訳などのいくつかのフィールドを追加することによって、テストしています彼らは完全に動作します
Sylius\Component\Product\Model\Product:
exclusion_policy: ALL
xml_root_name: product
properties:
id:
expose: true
type: integer
xml_attribute: true
name:
expose: true
type: string
description:
expose: true
type: string
attributes:
expose: true
max_depth: 2
createdAt:
expose: true
type: DateTime
updatedAt:
expose: true
type: DateTime
archetype:
expose:
serialized_name: archetypes
translations:
expose: true
serialized_name: translations
virtual_properties:
getVariants:
serialized_name: variants
どのようにこの設定を上書きできますか? > YourBundle \エンティティ\製品に配置する必要があります -