src/Observers/ProductInventoryUpdateObserver.php
protected function initializeStockItem(array $attr)
    {

        // load the stock item with the passed item/product/stock ID
        $entity = $this->loadStockItem(
            $attr[MemberNames::PRODUCT_ID],
            $attr[MemberNames::WEBSITE_ID],
            $attr[MemberNames::STOCK_ID]
        );

        // merge the attributes with the entity, if available
        if ($entity) {
            return $this->mergeEntity($entity, $attr);
        }

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

        // load the stock item with the passed item/product/stock ID
        $entity = $this->loadStockItem(
            $attr[MemberNames::PRODUCT_ID],
            $attr[MemberNames::WEBSITE_ID],
            $attr[MemberNames::STOCK_ID]
        );

        // merge the attributes with the entity, if available
        if ($entity) {
            return $this->mergeEntity($entity, $attr);
        }

        // otherwise simply return the attributes
        return $attr;
    }
protected function initializeStockItem ( array $ attr ) { // load the stock item with the passed item/product/stock ID $ entity = $ this -> loadStockItem ( $ attr [ MemberNames :: PRODUCT_ID ] , $ attr [ MemberNames :: WEBSITE_ID ] , $ attr [ MemberNames :: STOCK_ID ] ) ; // merge the attributes with the entity, if available if ( $ entity ) { return $ this -> mergeEntity ( $ entity , $ attr ) ; } // otherwise simply return the attributes return $ attr ; }
Initialize the stock item with the passed attributes and returns an instance.

@param array $attr The stock item attributes

@return array The initialized stock item
Initialize the stock item with the passed attributes and returns an instance .