@param array $givenMediaIds
@param array $existingMediaIds

@throws ProductException
779799
private function checkMediaIds(array $givenMediaIds, array $existingMediaIds)
    {
        $difference = array_diff($givenMediaIds, $existingMediaIds);
        if (count($difference)) {
            throw new ProductException(sprintf('The media ids %s were not found', implode(',', $difference)));
        }
    }
507665
public function deleteMedia($mediaId)
    {
        if ($mediaId instanceof Media) {
            $mediaId = $mediaId->id;
        }

        $media = $this->media->find($mediaId);

        if (! $media) {
            throw MediaCannotBeDeleted::doesNotBelongToModel($mediaId, $this);
        }

        $media->delete();
    }
781337
protected function _removeProductSuggestions( $productId, $listTypeId,
		MShop_Common_Manager_Interface $productListManager )
	{
		$search = $productListManager->createSearch();
		$expr = array(
			$search->compare( '==', 'product.list.parentid', $productId ),
			$search->compare( '==', 'product.list.type.id', $listTypeId )
		);

		$search->setConditions( $search->combine( '&&', $expr ) );
		$listItems = $productListManager->searchItems( $search );

		$productListManager->deleteItems( array_keys( $listItems ) );
	}
1234101
public void setAddSubnetIds(java.util.Collection<String> addSubnetIds) {
        if (addSubnetIds == null) {
            this.addSubnetIds = null;
            return;
        }

        this.addSubnetIds = new com.amazonaws.internal.SdkInternalList<String>(addSubnetIds);
    }
50653
public static function addAdditionalNodeIDPerObject( $contentObjectID, $additionalNodeID )
    {
        if ( !isset( self::$additionalNodeIDsPerObject[$contentObjectID] ) )
        {
            self::$additionalNodeIDsPerObject[$contentObjectID] = array();
        }

        self::$additionalNodeIDsPerObject[$contentObjectID][] = $additionalNodeID;
    }
711050
public function addCustomerRelations(int $idProductList, array $customerIds): void
    {
        foreach ($customerIds as $idCustomer) {
            $productListCustomerEntity = new SpyProductListCustomer();
            $productListCustomerEntity->setFkProductList($idProductList)
                ->setFkCustomer($idCustomer)
                ->save();
        }
    }
488172
public function deletemedia()
    {
        $soxId = $this->getEditObjectId();
        $sMediaId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("mediaid");
        if ($sMediaId && $soxId) {
            $oMediaUrl = oxNew(\OxidEsales\Eshop\Application\Model\MediaUrl::class);
            $oMediaUrl->load($sMediaId);
            $oMediaUrl->delete();
        }
    }
542496
protected function controlLimit(array &$product_ids)
    {
        $limit = $this->getLimit();

        if (!empty($limit)) {
            $product_ids = array_slice($product_ids, 0, $limit);
        }
    }
221420
private function typeCompareAgainstSupportedMediaTypes(array $aggregatedValues)
    {
        foreach ($aggregatedValues as $mediaType => $attributes) {
            if ('*/*' === $mediaType) {
                continue;
            }

            $mediaTypeParts = explode('/', $mediaType);
            if (2 !== count($mediaTypeParts)) {
                continue; // skip invalid value
            }

            list($type, $subType) = $mediaTypeParts;

            if ('*' === $type || '*' !== $subType) {
                continue; // skip invalid value
            }

            foreach ($this->supportedMediaTypes as $supportedMediaType) {
                if (1 === preg_match('/^'.preg_quote($type).'\/.+$/', $supportedMediaType)) {
                    return new NegotiatedValue($supportedMediaType, $attributes);
                }
            }
        }

        return null;
    }
1237181
public function remove($id, $mediaId)
    {
        return $this->getFactory()->createResult(
            $this->getApi()->removeMediaFromList($id, $mediaId)
        );
    }
1138831
public function loadCategoryData($storeId, $productIds)
    {
        $select       = $this->getCategoryProductSelect($productIds, $storeId);
        $categoryData = $this->getConnection()->fetchAll($select);

        $categoryIds = [];

        foreach ($categoryData as $categoryDataRow) {
            $categoryIds[] = $categoryDataRow['category_id'];
        }

        $storeCategoryName = $this->loadCategoryNames(array_unique($categoryIds), $storeId);

        foreach ($categoryData as &$categoryDataRow) {
            $categoryDataRow['name'] = '';
            if (isset($storeCategoryName[(int) $categoryDataRow['category_id']])) {
                $categoryDataRow['name'] = $storeCategoryName[(int) $categoryDataRow['category_id']];
            }
        }

        return $categoryData;
    }
1172821
public function addInitialDocumentIds(\AgentSIB\Diadoc\Api\Proto\DocumentId $value)
    {
        if ($this->InitialDocumentIds === null) {
            $this->InitialDocumentIds = new \Protobuf\MessageCollection();
        }

        $this->InitialDocumentIds->add($value);
    }
1374001
public function loadProductById($productId)
    {
        $collection = $this->catalogCollection->create()
            ->addFieldToFilter('product_id', $productId)
            ->setPageSize(1);

        return $collection->getFirstItem();
    }
825470
public void setProductSubscriptions(java.util.Collection<String> productSubscriptions) {
        if (productSubscriptions == null) {
            this.productSubscriptions = null;
            return;
        }

        this.productSubscriptions = new java.util.ArrayList<String>(productSubscriptions);
    }
1299862
public function saveMediaCategoryAssignments(int $mediaId, array $categoryIds = null)
    {
        // Delete current category assignments for this media ID
        $this->deleteMediaCategoryAssignments($mediaId);

        // Insert all assignments, if the category ID's array is not empty
        if (null !== $categoryIds) {
            $this->sql = 'insert into media_category_map (media_id, category_id) values ';
            foreach ($categoryIds as $id) {
                $this->sql .= '(?, ?),';
                $this->bindValues[] = $mediaId;
                $this->bindValues[] = $id;
            }
            $this->sql = rtrim($this->sql, ',') . ';';
            $this->execute();
        }
    }
728915
public function deleteProductAddonAction($productId, $addonId)
    {
        $this->getManager()->deleteProductAddon($productId, $addonId);
        $this->getDoctrine()->getManager()->flush();

        $view = $this->view();

        return $this->handleView($view);
    }
1152205
public function setChannelIds(array $channelIds)
    {
        foreach ($channelIds as $channelId) {
            if (!is_numeric($channelId)) {
                throw new \Exception('Channel ID should be numeric.');
            }
        }

        $this->channels = $channelIds;

        return $this;
    }