/** * @return void */ protected function checkEavEntities() { $this->progress->advance(); $eavAttributes = $this->helper->getEavAttributes(); $destEavEntities = $this->getEavEntities($eavAttributes); foreach ($eavAttributes as $field) { if (!in_array($field, $destEavEntities)) { $this->missingDocumentFields['destination']['eav_attribute'][] = $field; } } }
/** * @param array $data * @param ResourceModel\Document $sourceDocument * @param Record\Collection $destEavCollection * @return void */ public function migrateAdditionalOrderData($data, $sourceDocument, $destEavCollection) { foreach ($this->helper->getEavAttributes() as $orderEavAttribute) { $eavAttributeData = $this->prepareEavEntityData($orderEavAttribute, $data); if ($eavAttributeData) { $attributeRecord = $this->recordFactory->create(['document' => $sourceDocument, 'data' => $eavAttributeData]); $destEavCollection->addRecord($attributeRecord); } } }
/** * @return void */ protected function checkEavEntities() { $countBeforeRun = $this->initialData->getDestEavAttributesCount($this->helper->getDestEavDocument()); $countAfterRun = $this->destination->getRecordsCount($this->helper->getDestEavDocument()); $countEavAttributes = null; foreach ($this->helper->getEavAttributes() as $eavAttribute) { $countEavAttributes += count($this->helper->getSourceAttributes($eavAttribute)); } if ($countBeforeRun + $countEavAttributes != $countAfterRun) { $this->errors[] = sprintf('Mismatch of entities in the document: %s', $this->helper->getDestEavDocument()); } }
/** * @return void */ public function testGetEavAttributes() { $eavAttributes = ['reward_points_balance_refunded', 'reward_salesrule_points']; $this->assertEquals($eavAttributes, $this->helper->getEavAttributes()); }