Exemplo n.º 1
0
 /**
  * Load migrated attributes data
  * @return array
  */
 protected function loadNewAttributes()
 {
     $this->newAttributes = $this->helper->getDestinationRecords('eav_attribute', ['entity_type_id', 'attribute_code']);
     foreach ($this->initialData->getAttributes('dest') as $key => $attributeData) {
         $this->destAttributeOldNewMap[$attributeData['attribute_id']] = $this->newAttributes[$key]['attribute_id'];
     }
     return $this->newAttributes;
 }
 /**
  * @return void
  */
 public function testGetDestinationRecordsNoKey()
 {
     $row = ['key' => 'key_value', 'field' => 'field_value'];
     $this->map->expects($this->once())->method('getDocumentMap')->with('test_source_document', MapInterface::TYPE_SOURCE)->will($this->returnValue('test_dest_document'));
     $this->destination->expects($this->once())->method('getRecordsCount')->will($this->returnValue(1));
     $this->destination->expects($this->once())->method('getRecords')->with('test_dest_document', 0, 1)->will($this->returnValue([$row]));
     $this->assertEquals([$row], $this->helper->getDestinationRecords('test_source_document'));
 }
Exemplo n.º 3
0
 /**
  * @return void
  */
 protected function validateCatalogEavAttributes()
 {
     foreach ($this->helper->getDestinationRecords('catalog_eav_attribute') as $attribute) {
         foreach (['frontend_input_renderer'] as $field) {
             if ($attribute[$field] !== null && !class_exists($attribute[$field])) {
                 $this->errors[] = 'Incorrect value: ' . $attribute[$field] . ' in: catalog_eav_attribute.' . $field . ' for attribute_id=' . $attribute['attribute_id'];
             }
         }
     }
 }
 /**
  * Load attribute group data before migration
  * @return void
  */
 protected function initAttributeGroups()
 {
     $this->attributeGroups['dest'] = $this->helper->getDestinationRecords('eav_attribute_group', ['attribute_set_id', 'attribute_group_name']);
 }