问题描述
我创建了具有属性AcmeBundle\Api\Model\AcmeLineItem
和product
的模型productUnit
。然后,我添加了一个新的处理器,用于设置模型项的结果集合,并使用标记注册它:
- { name: oro.api.processor,action: get_list,group: load_data,requestType: frontend,class: AcmeBundle\Api\Model\AcmeLineItem,priority: 55 }
api_frontend.yml
中的模型配置:
AcmeBundle\Api\Model\AcmeLineItem:
fields:
quantity:
data_type: string
productSku:
data_type: string
product:
target_class: Oro\Bundle\ProductBundle\Entity\Product
target_type: to-one
property_path: product
productUnit:
target_class: Oro\Bundle\ProductBundle\Entity\ProductUnit
target_type: to-one
actions:
get: false
get_list:
description: Get bought line items
disable_sorting: true
update: false
delete: false
delete_list: false
create: false
简单的请求工作正常,但是使用include
参数时出现了问题。值productUnit
的相关项在响应中可见,但值product
-响应中的异常,具有500条代码和[Semantical Error] line 0,col -1 near 'SELECT r FROM': Error: Cannot select entity through identification variables without choosing at least one root entity alias.
消息。
通过调试,我发现在通过varianProducts
对product
实体的@oro_api.object_normalizer
属性进行规范化期间发生了异常。我没有t found a similar exception for the included products on
shippinglistitems的API方法,像这样的接缝使用了与产品实体不同的规范化器。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)