I have extended entity user.
namespace MyShop\CoreBundle\Entity;
use Sylius\Component\Core\Model\User as BaseUser;
class User extends BaseUser
Next, I want to expose email
and exclude, for example, id
field.
How should I config these conditions?
I found this solution中提取href并在app/config/config.yml
中添加配置:
jms_serializer:
metadata:
directories:
myshop-user:
namespace_prefix: "MyShop\\CoreBundle\\Entity"
path: "@MyShopCoreBundle/Resources/config/serializer"
但是sylius没有看到我的MyShop/CoreBundle/Resources/config/serializer/Model.User.yml
MyShop\CoreBundle\Entity\User:
exclusion_policy: ALL
xml_root_name: user
properties:destroyyamlfile
id:
expose: false
type: integer
email:
expose: true
type: string
我故意摧毁它,但框架运作良好,并没有看到我错误的版本。
那么应该如何在app/config/config.yml
和Model.User.yml
??