我在我的symfony2项目中,有一个自定义实体(entity)位于Bundle和框架之外。
我需要将json数据设置到这个实体中,但是我无法正确配置yaml文件。
app/config/config.yml
jms_serializer:
metadata:
auto_detection: true
directories:
CORE:
namespace_prefix: "Core\Domain\Model"
path: "%kernel.root_dir%/Resources/serializer/CORE"
app/Resources/serializer/CORE/Model.Product.yml
Core\Domain\Model\Product\Product:
properties:
id:
type: integer
objectId:
type: string
name:
type: string ...
这个bundle是否无法处理在bundles之外的实体?
我一直看到错误信息:必须为Core\Domain\Model\Product\Product::$id定义一个类型。
我认为JMSSerializerBundle不能读取yaml文件,因为使用注释可以正常工作。
有什么想法吗?
谢谢。