This topic contains 0 replies, has 1 voice, and was last updated by archy_bold 7 years, 11 months ago.
- Topic
Hi there.
I’m setting up an automated import for a custom entity in my bundle. The imported data contains an ID referencing a related entity. I’ve set up my import process and can import the data that is directly on the entity without any issue. However, it doesn’t join with the related entity.
I’ve got my dataconverter converting to the correct format:
123456789101112131415161718192021222324class [Entity]DataConverter extends AbstractTreeDataConverter{/*** {@inheritdoc}*/protected function getHeaderConversionRules(){return ['id' => 'originId','day' => 'date','orderId' => 'order:originId','amount' => 'amount',];}/*** {@inheritdoc}*/protected function getBackendHeader(){return array($this->getHeaderConversionRules());}}So I’m trying to link to the Orderentity on originId.
The relation is defined on the entity as follows:
123456789101112131415class [Entity] extends Extend[Entity]{/*** @ORM\ManyToOne(targetEntity="Order", inversedBy="refunds")* @ORM\JoinColumn(name="order_id", referencedColumnName="id", onDelete="CASCADE")* @ConfigField(* defaultValues={* "importexport"={* "full"=false* }* }* )*/protected $order;}I feel like I need to do some conversion in the Strategy, but I’m not really sure of the best way to do it. The order should already be imported, so I just want to join to the existing entity. Any help on the best way to approach this would be greatly appreciated.
Thanks,
Simon
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.