@param int $idProductList
@param array $companyIds

@return void
192337
public function removeCompanyRelations(int $idProductList, array $companyIds): void
    {
        if (count($companyIds) === 0) {
            return;
        }

        $productListCompanyEntities = $this->getFactory()
            ->createProductListCompanyQuery()
            ->filterByFkProductList($idProductList)
            ->filterByFkCompany_In($companyIds)
            ->find();

        foreach ($productListCompanyEntities as $productListCompany) {
            $productListCompany->delete();
        }
    }
1019176
@Override
	public void removeByUuid_C(String uuid, long companyId) {
		for (CommerceWishList commerceWishList : findByUuid_C(uuid, companyId,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceWishList);
		}
	}
1105010
@Override
	public void removeByCompanyId(long companyId) {
		for (CPDefinition cpDefinition : findByCompanyId(companyId,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinition);
		}
	}
260779
protected function checkProductIDField()
    {
        //Clear product cache
        /** @var int $iOriginalProductID */
        $iOriginalProductID = $this->obElement->getOriginal('product_id');

        /** @var int $iProductID */
        $iProductID = $this->obElement->getAttribute('product_id');

        if ($iOriginalProductID == $iProductID) {
            return;
        }

        if (!empty($iOriginalProductID)) {
            $this->clearProductItemCache($iOriginalProductID);
        }

        if (!empty($iProductID)) {
            $this->clearProductItemCache($iProductID);
        }
    }
227845
protected function resetProductIds(){
        foreach($this->options as $op=>$junk){
            if(preg_match("#IdList#",$op)){
                unset($this->options[$op]);
            }
        }
    }
1235042
public function loadDescendantIDListInto(&$idList) {
        if($children=$this->AllChildren()) {
            foreach($children as $child) {
                if(in_array($child->ID, $idList)) {
                    continue;
                }
                $idList[]=$child->ID;
                $ext=$child->getExtensionInstance('Hierarchy');
                $ext->setOwner($child);
                $ext->loadDescendantIDListInto($idList);
                $ext->clearOwner();
            }
        }
    }
1152840
public function getRelatedCustomerIdsByIdProductList(int $idProductList): array
    {
        /** @var \Orm\Zed\ProductList\Persistence\SpyProductListCustomerQuery $productListCustomerQuery */
        $productListCustomerQuery = $this->getFactory()
            ->createProductListCustomerQuery()
            ->select(SpyProductListCustomerTableMap::COL_FK_CUSTOMER);

        return $productListCustomerQuery
            ->findByFkProductList($idProductList)
            ->toArray();
    }
855450
protected function prepareProductInformation($addProductId, $productInfo)
    {
        $return = [];

        $return['id'] = isset($productInfo['aid']) ? $productInfo['aid'] : $addProductId;
        $return['amount'] = isset($productInfo['am']) ? $productInfo['am'] : 0;
        $return['selectList'] = isset($productInfo['sel']) ? $productInfo['sel'] : null;

        $return['persistentParameters'] = $this->getPersistedParameters($productInfo['persparam']);
        $return['override'] = isset($productInfo['override']) ? $productInfo['override'] : null;
        $return['bundle'] = isset($productInfo['bundle']) ? true : false;
        $return['oldBasketItemId'] = isset($productInfo['basketitemid']) ? $productInfo['basketitemid'] : null;

        return $return;
    }
168209
public function indexProduct($product_id)
    {
        $this->setProduct($product_id);
        $this->setMetaIndexProduct();
        $this->setTitleIndexProduct();
        $this->setBreadcrumbIndexProduct();
        $this->setHtmlFilterIndexProduct();

        $this->setData('product', $this->data_product);

        $this->setDataSummaryIndexProduct();
        $this->setDataImagesIndexProduct();
        $this->setDataCartFormIndexProduct();
        $this->setDataRatingWidgetIndexProduct();

        $this->setDataDescriptionIndexProduct();
        $this->setDataAttributesIndexProduct();
        $this->setDataReviewsIndexProduct();
        $this->setDataRecentIndexProduct();
        $this->setDataRelatedIndexProduct();
        $this->setDataBundledIndexProduct();

        $this->setJsIndexProduct();
        $this->outputIndexProduct();
    }
732263
public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder)
    {
        if (companyId < 0 || 0xFFFF < companyId)
        {
            String message = String.format("'companyId' is out of the valid range: %d", companyId);
            throw new IllegalArgumentException(message);
        }

        if (builder == null)
        {
            return;
        }

        // Use the company ID as the key for the builder.
        Integer key = Integer.valueOf(companyId);

        // Get the existing list of builders for the company ID.
        List<ADManufacturerSpecificBuilder> builders = mMSBuilders.get(key);

        // If no builder has been registered for the company ID yet.
        if (builders == null)
        {
            builders = new ArrayList<ADManufacturerSpecificBuilder>();
            mMSBuilders.put(key, builders);
        }

        // Register the builder at the beginning of the builder list.
        builders.add(0, builder);
    }
1374646
public void setCompany(final Company _company)
        throws CacheReloadException
    {
        if (_company == null) {
            this.companyId = null;
        } else {
            this.companyId = _company.getId();
        }
    }
56226
protected function addListItems( $productId, array $productIds )
	{
		if( empty( $productIds ) ) {
			return;
		}

		$manager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' );
		$item = $manager->createItem();

		foreach( $productIds as $pos => $refid )
		{
			$item->setId( null );
			$item->setParentId( $productId );
			$item->setDomain( 'product' );
			$item->setType( 'bought-together' );
			$item->setPosition( $pos );
			$item->setRefId( $refid );
			$item->setStatus( 1 );

			$manager->saveItem( $item, false );
		}
	}
298311
@Override
	public java.util.List<com.liferay.commerce.product.model.CProduct> getCProductsByUuidAndCompanyId(
		String uuid, long companyId) {
		return _cProductLocalService.getCProductsByUuidAndCompanyId(uuid,
			companyId);
	}
82184
public function getByProductIds(array $productIds, $storeId)
    {
        $searchQueryTable = $this->getTable('search_query');
        $select = $this->getBaseSelect()
            ->joinInner($searchQueryTable, "main_table.query_id = {$searchQueryTable}.query_id", [])
            ->where('product_id IN(?)', $productIds)
            ->where('store_id = ?', $storeId)
            ->columns(['product_id', 'query_id', 'position', 'is_blacklisted']);

        return $this->getConnection()->fetchAll($select);
    }
1362102
protected function clearListByPromoBlock($arAttachedIDList)
    {
        if ($this->sRelationName != 'promo_block') {
            return;
        }

        foreach ($arAttachedIDList as $iPromoBlockID) {
            ProductListStore::instance()->promo_block->clear($iPromoBlockID);
        }
    }
917713
protected function addProductListsToCustomerTransfer(
        CustomerTransfer $customerTransfer,
        ProductListCollectionTransfer $productListCollectionTransfer
    ): void {
        foreach ($productListCollectionTransfer->getProductLists() as $productListTransfer) {
            $idProductList = $productListTransfer->getIdProductList();

            if ($productListTransfer->getType() === static::TYPE_WHITELIST) {
                $customerTransfer->getCustomerProductListCollection()->addWhitelistId($idProductList);

                continue;
            }

            $customerTransfer->getCustomerProductListCollection()->addBlacklistId($idProductList);
        }
    }
1092944
public function addProducts($productIds)
    {
        $fullTextIndexer    = $this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID);
        $indexerChangeLog   = $fullTextIndexer->getView()->getChangelog();

        $changelogTableName = $indexerChangeLog->getName();
        $columnName         = $indexerChangeLog->getColumnName();

        try {
            $indexerChangeLog->create();

            $this->resource->getConnection()->insertArray(
                $changelogTableName,
                [$columnName],
                $productIds
            );
        } catch (\Exception $e) {
            throw new CouldNotSaveException(__(
                'Could not schedule products for reindexing : %1',
                $e->getMessage()
            ));
        }
    }