Returns the itemsData array to be viewed;
@var \Magento\Quote\Model\Quote\Item $quoteItem
@param Product $_product
@param  Product$_parentProduct
@return array
160485
private function getItemsData($quoteItem, $_product, $_parentProduct)
    {
        $totalPrice = (!isset($_parentProduct) ? $quoteItem->getBaseRowTotalInclTax() : $quoteItem->getParentItem()->getBaseRowTotalInclTax());
        $inStock = ($_product->isInStock())
            ? 'In Stock'
            : 'Out of stock';
        $total = $this->priceHelper->currency(
            $totalPrice,
            true,
            false
        );

        $productUrl = (isset($_parentProduct) ? $this->urlFinder->fetchFor($_parentProduct) : $this->urlFinder->fetchFor($_product));
        $grandTotal = $this->priceHelper->currency(
            $this->getGrandTotal(),
            true,
            false
        );
        $itemsData = [
            'grandTotal' => $grandTotal,
            'total' => $total,
            'inStock' => $inStock,
            'productUrl' => $productUrl,
            'product' => (isset($_parentProduct) ? $_parentProduct : $_product),
            'qty' => isset($_parentProduct) ? $quoteItem->getParentItem()->getQty() : $quoteItem->getQty(),
            'product_details' => $_product
        ];

        return $itemsData;
    }
439343
public function getProductBanRegex($product) {
        $urlPatterns = array();
        foreach ($this->getParentProducts($product) as $parentProduct) {
            if ($parentProduct->getUrlKey()) {
                $urlPatterns[] = $parentProduct->getUrlKey();
            }
        }
        if ($product->getUrlKey()) {
            $urlPatterns[] = $product->getUrlKey();
        }
        if (empty($urlPatterns)) {
            $urlPatterns[] = "##_NEVER_MATCH_##";
        }
        $pattern = sprintf('(?:%s)', implode('|', $urlPatterns));
        return $pattern;
    }
138764
protected function getItemsFromDatabase()
    {
        $brandId = $this->repository->make('antares.memory')->make('primary')->get('brand.default');
        if (auth()->guest()) {
            return [];
        }
        $roleId = auth()->user()->roles->first()->id;
        $items  = $this->resolver()->where(['brand_id' => $brandId, 'role_id' => $roleId])->get();
        $return = [];

        foreach ($items as $item) {
            $form       = $item->form;
            $attributes = array_merge($item->getAttributes(), ['action_id' => $form->action_id, 'name' => $form->name]);
            array_push($return, $attributes);
        }
        return $return;
    }
809201
public function parent(\WC_Product $WC_Product)
    {
        if (!$WC_Product->exists()) {
            return null; // Not possible.
        }
        if ($WC_Product->is_type('variation')) {
            $WC_Parent_Product = wc_get_product($WC_Product->get_parent_id());
        } else {
            $WC_Parent_Product = null; // Not applicable.
        }
        return $WC_Parent_Product instanceof \WC_Product && $WC_Parent_Product->exists() ? $WC_Parent_Product : null;
    }
1250215
public function getItems($product_id)
    {
        $product_ids = array();
        foreach ($this->getList(array('product_id' => $product_id)) as $item) {
            $product_ids[] = $item['item_product_id'];
        }

        return $product_ids;
    }
308950
public function find_parent_item_in_menu( $menu_items, $parent_id ) {
		foreach ( $menu_items as &$item ) {
			if ( $item->ID == $parent_id ) {
				return $item;
			}
		}
	}
1312420
final protected function parseData(array $data, $parentId = 0)
    {
        $result = array();

        foreach ($data as $subArray) {
            $nested = array();

            if (isset($subArray[$this->childrenKey])) {
                // Recursive call
                $nested = $this->parseData($subArray[$this->childrenKey], $subArray[RelationBuilder::TREE_PARAM_ID]);
            }

            $result[] = array(
                RelationBuilder::TREE_PARAM_ID => $subArray[RelationBuilder::TREE_PARAM_ID], 
                RelationBuilder::TREE_PARAM_PARENT_ID => $parentId
            );

            $result = array_merge($result, $nested);
        }

        return $result;
    }
954726
def _getModelData(self, modelData, parentItem=None):
        """"""
        if parentItem is None:
            parentItem = self.rootItem

        for item in parentItem.getChildren():
            key = item.getItemData(0)
            if item.childCount():
                modelData[key] = odict()
                self._getModelData(modelData[key], item)
            else:
                if isinstance(item.getItemData(2), float):
                    modelData[key] = [item.getItemData(1), item.getItemData(2)]
                else:
                    modelData[key] = item.getItemData(1)
848380
public function getItemId()
    {
        if ($this->getProductCustomOption()) {
            return $this->getItem()->getData('product_id')
                . '-' . $this->getProductCustomOption()->getProduct()->getId();
        }

        return parent::getItemId();
    }
916327
public function getProductsToDisplay($items, $mode, &$productsToDisplayCounter, $limit, $maxPerChild)
    {
        $productsToDisplay = [];

        foreach ($items as $item) {
            //parent product
            $productModel = $item->getProduct();
            //check for product exists
            if ($productModel->getId()) {
                //get single product for current mode
                $recommendedProductIds = $this->getRecommendedProduct($productModel, $mode);
                $recommendedProducts = $this->catalog->getProductCollectionFromIds($recommendedProductIds);

                $this->addRecommendedProducts(
                    $productsToDisplayCounter,
                    $limit,
                    $maxPerChild,
                    $recommendedProducts,
                    $productsToDisplay
                );
            }
            //have reached the limit don't loop for more
            if ($productsToDisplayCounter == $limit) {
                break;
            }
        }

        return $productsToDisplay;
    }
1003243
private function loadSimpleVariation(Product $parentProduct, array $filterArray)
    {
        $childProduct = $this->swatchHelperData->loadVariationByFallback($parentProduct, $filterArray);
        if ($childProduct && !$childProduct->getImage()) {
            $childProduct = $this->swatchHelperData->loadFirstVariationWithImage($parentProduct, $filterArray);
        }
        if (!$childProduct) {
            $childProduct = $parentProduct;
        }

        return $childProduct;
    }
1272133
function productOptionInformation( $objectAttribute, $optionID, $productItem )
    {
        $multioption = $objectAttribute->attribute( 'content' );

        foreach ( $multioption->attribute( 'multioption_list' ) as $multioptionElement )
        {
            foreach ( $multioptionElement['optionlist'] as $option )
            {
                if ( $option['option_id'] != $optionID )
                    continue;

                return array( 'id' => $option['option_id'],
                              'name' => $multioptionElement['name'],
                              'value' => $option['value'],
                              'additional_price' => $option['additional_price'] );
            }
        }
    }
176530
public function getData(ProductInterface $product)
    {
        $productItemData = [
            'id'          => $product->getId(),
            'sku'         => $product->getSku(),
            'name'        => $product->getName(),
            'price'       => $this->getProductPrice($product),
            'image'       => $this->getImageUrl($product),
            'score'       => $product->getDocumentScore(),
            'is_in_stock' => $this->isInStockProduct($product),
        ];

        return $productItemData;
    }
143842
public function getItem($item, &$parents = [])
    {
        if (is_array($item) && !$this->isRoute($item)) {
            $item = $item['url'];
        }
        if (is_string($item) && strpos($item, '/') === false) {
            $item = implode('.items.', explode('.', $item));
            return ArrayHelper::getValue($this->getItems(), $item);
        }
        return $this->findItemRecursive($item, $this->getItems(), $parents);
    }
1308705
protected function _getItemsData()
    {
        $items = [];

        /** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
        $productCollection = $this->getLayer()->getProductCollection();
        $optionsFacetedData = $productCollection->getFacetedData('categories');

        $currentCategory = $this->dataProvider->getCategory();
        $categories = $this->getChildrenCategories();

        if ($currentCategory->getIsActive()) {
            foreach ($categories as $category) {
                if (isset($optionsFacetedData[(int) $category->getId()])) {
                    $productCount = $optionsFacetedData[$category->getId()]['count'];
                    if ($category->getIsActive() && $productCount > 0) {
                        $item = [
                            'label' => $this->escaper->escapeHtml($category->getName()),
                            'value' => $category->getId(),
                            'count' => $optionsFacetedData[$category->getId()]['count'],
                            'url'   => $category->getUrl(),
                        ];

                        $items[] = $item;
                    }
                }
            }
        }

        return $items;
    }
810572
public function toArray()
	{
		$list = parent::toArray();

		$list['product.stock.productid'] = $this->getProductId();
		$list['product.stock.warehouseid'] = $this->getWarehouseId();
		$list['product.stock.stocklevel'] = $this->getStocklevel();
		$list['product.stock.dateback'] = $this->getDateBack();

		return $list;
	}
274979
public function getChildren(MenuItem $parent = null)
    {
        if ($parent === null) {
            return $this->getTopChildren();
        }
        /* @var $request Request */
        $request = $this->container->get('request_stack')->getCurrentRequest();
        $result = array();
        foreach ($this->getAdaptors() as $menuAdaptor) {
            $menuAdaptor->adaptChildren($this, $result, $parent, $request);
        }

        return $result;
    }