cancel
Showing results for 
Search instead for 
Did you mean: 

extension_attributes join reference_table bug?

extension_attributes join reference_table bug?

Hi, I made custom module using extension attributes, as described in doc: http://devdocs.magento.com/guides/v2.2/extension-dev-guide/attributes.html

 

When I use in extension_attributes.xml join table, like this:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
<extension_attributes for="Magento\Customer\Api\Data\CustomerInterface">
<attribute code="loyalty_programs" type="Sprii\LoyaltyProgram\Api\Data\LoyaltyProgramInterface[]" >
<join reference_table="sprii_loyalty" reference_field="customer_id" join_on_field="entity_id">
<field>card_number</field>
<field>valid_from</field>
</join>
</attribute>
</extension_attributes>
</config>

 

I get following error:

"

join directives cannot be processed for attribute (loyalty_programs) of extensible entity (Magento\Customer\Api\Data\CustomerInterface) which has an Array type (Sprii\LoyaltyProgram\Api\Data\LoyaltyProgramInterface[])

"

When I delete this join, module works fine. And Customer module works fine too, and my attributes are visible and searchable in Customer module.

According to http://devdocs.magento.com/guides/v2.2/extension-dev-guide/attributes.html#search , what for is this join if system works without it?