public function initializeAttributes(EavIterator $iterator): self
    {
        // Add default attributes
        $iterator->selectAttribute('name');
        $iterator->selectAttribute('sku');
        $iterator->selectAttribute('url_key');
        $iterator->selectAttribute('status');
        $iterator->selectAttribute('visibility');
        $iterator->selectAttribute('type_id');

        // Add configured attributes
        $type = $this->config->getEntityType(Product::ENTITY);

        /** @var Attribute $attribute */
        foreach ($type->getAttributeCollection() as $attribute) {
            if (!$this->helper->shouldExportAttribute($attribute)) {
                continue;
            }

            $iterator->selectAttribute($attribute->getAttributeCode());
        }
        return $this;
    }
public function initializeAttributes(EavIterator $iterator): self
    {
        // Add default attributes
        $iterator->selectAttribute('name');
        $iterator->selectAttribute('sku');
        $iterator->selectAttribute('url_key');
        $iterator->selectAttribute('status');
        $iterator->selectAttribute('visibility');
        $iterator->selectAttribute('type_id');

        // Add configured attributes
        $type = $this->config->getEntityType(Product::ENTITY);

        /** @var Attribute $attribute */
        foreach ($type->getAttributeCollection() as $attribute) {
            if (!$this->helper->shouldExportAttribute($attribute)) {
                continue;
            }

            $iterator->selectAttribute($attribute->getAttributeCode());
        }
        return $this;
    }
public function initializeAttributes ( EavIterator $ iterator ) : self { // Add default attributes $ iterator -> selectAttribute ( 'name' ) ; $ iterator -> selectAttribute ( 'sku' ) ; $ iterator -> selectAttribute ( 'url_key' ) ; $ iterator -> selectAttribute ( 'status' ) ; $ iterator -> selectAttribute ( 'visibility' ) ; $ iterator -> selectAttribute ( 'type_id' ) ; // Add configured attributes $ type = $ this -> config -> getEntityType ( Product :: ENTITY ) ; /** @var Attribute $attribute */ foreach ( $ type -> getAttributeCollection ( ) as $ attribute ) { if ( ! $ this -> helper -> shouldExportAttribute ( $ attribute ) ) { continue ; } $ iterator -> selectAttribute ( $ attribute -> getAttributeCode ( ) ) ; } return $ this ; }
Select all attributes who should be exported

@param EavIterator $iterator
@return $this
Select all attributes who should be exported