protected function initializeBundleSelection(array $attr)
    {

        try {
            // try to load the product bundle option SKU/ID
            $parentProductId= $this->mapSku($this->getValue(ColumnKeys::BUNDLE_PARENT_SKU));
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::BUNDLE_PARENT_SKU), $e);
        }

        try {
            // try to load the product ID
            $productId = $this->mapSku($this->getValue(ColumnKeys::BUNDLE_VALUE_SKU));
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::BUNDLE_PARENT_SKU), $e);
        }

        // load the actual option ID
        $optionId = $this->getLastOptionId();

        // try to load the bundle selection with the passed option/product/parent product ID
        if ($entity = $this->loadBundleSelection($optionId, $productId, $parentProductId)) {
            return $this->mergeEntity($entity, $attr);
        }

        // simply return the attributes
        return $attr;
    }
protected function initializeBundleSelection(array $attr)
    {

        try {
            // try to load the product bundle option SKU/ID
            $parentProductId= $this->mapSku($this->getValue(ColumnKeys::BUNDLE_PARENT_SKU));
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::BUNDLE_PARENT_SKU), $e);
        }

        try {
            // try to load the product ID
            $productId = $this->mapSku($this->getValue(ColumnKeys::BUNDLE_VALUE_SKU));
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::BUNDLE_PARENT_SKU), $e);
        }

        // load the actual option ID
        $optionId = $this->getLastOptionId();

        // try to load the bundle selection with the passed option/product/parent product ID
        if ($entity = $this->loadBundleSelection($optionId, $productId, $parentProductId)) {
            return $this->mergeEntity($entity, $attr);
        }

        // simply return the attributes
        return $attr;
    }
protected function initializeBundleSelection ( array $ attr ) { try { // try to load the product bundle option SKU/ID $ parentProductId = $ this -> mapSku ( $ this -> getValue ( ColumnKeys :: BUNDLE_PARENT_SKU ) ) ; } catch ( \ Exception $ e ) { throw $ this -> wrapException ( array ( ColumnKeys :: BUNDLE_PARENT_SKU ) , $ e ) ; } try { // try to load the product ID $ productId = $ this -> mapSku ( $ this -> getValue ( ColumnKeys :: BUNDLE_VALUE_SKU ) ) ; } catch ( \ Exception $ e ) { throw $ this -> wrapException ( array ( ColumnKeys :: BUNDLE_PARENT_SKU ) , $ e ) ; } // load the actual option ID $ optionId = $ this -> getLastOptionId ( ) ; // try to load the bundle selection with the passed option/product/parent product ID if ( $ entity = $ this -> loadBundleSelection ( $ optionId , $ productId , $ parentProductId ) ) { return $ this -> mergeEntity ( $ entity , $ attr ) ; } // simply return the attributes return $ attr ; }
Initialize the bundle selection with the passed attributes and returns an instance.

@param array $attr The bundle selection attributes

@return array The initialized bundle selection
Initialize the bundle selection with the passed attributes and returns an instance .