如何解决学说中的映射

时间:2020-07-25 22:16:53

标签: symfony doctrine-orm doctrine yaml

我有一个Store实体,并且我想拥有一对多的关系,其中对于每个Store我都可以选择一个ShippingMethod。我使用YAML进行映射。

shippingMethod属性已经添加到模型中。它只剩下解决映射的问题

EasyCommerce\StorePlugin\Entity\Store:
    type: mappedSuperclass
    table: easycommerce_store
    id:
        id:
            type: integer
            id: true
            generator:
                strategy: AUTO
    fields:
        //fields
    manyToOne:
        shippingMethod:
            targetEntity: Sylius\Component\Core\Model\ShippingMethodInterface;
            joinColumn:
                shipping_method_id:
                    referencedColumnName: id

错误消息:

In MappingException.php line 772:
                                                                                                                                                     
  The target-entity Sylius\Component\Core\Model\ShippingMethodInterface; cannot be found in 'EasyCommerce\StorePlugin\Entity\Store#shippingMethod'.

0 个答案:

没有答案