Filter product list by brand ID
@param int $iBrandID
@return $this
3481
public function brand($iBrandID)
    {
        $arResultIDList = ProductListStore::instance()->brand->get($iBrandID);

        return $this->intersect($arResultIDList);
    }
986615
public function filterItemsForReview($items, $customerId, $order)
    {
        foreach ($items as $key => $item) {
            $productId = $item->getProduct()->getId();

            $collection = $this->reviewFactory->create()->getCollection()
                ->addCustomerFilter($customerId)
                ->addStoreFilter($order->getStoreId())
                ->addFieldToFilter('main_table.entity_pk_value', $productId);

            //remove item if customer has already placed review on this item
            if ($collection->getSize()) {
                unset($items[$key]);
            }
        }

        return $items;
    }
88625
public function filterByIds($ids)
    {
        $this->getInstance()->andWhere($this->mainAlias.'.id IN (:ids)')->setParameter('ids', $ids);

        return $this;
    }
1213181
public function setId(int $id) : CNabuDataObject
    {
        if ($id === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$id")
            );
        }
        $this->setValue('nb_catalog_tag_id', $id);
        
        return $this;
    }
205037
public function withMetaId($id)
	{
		foreach (func_get_args() as $arg) {
			$meta_ids = (array) $arg;
			
			foreach ($meta_ids as $meta_id) {
				$this->filters[]['metas'][] = array('id' => $meta_id);
			}
		}
		
		return $this;
	}
532625
protected function getIDListFromCache() : array
    {
        $arElementIDList = parent::getIDListFromCache();

        //Get active product list
        $arActiveProductIDList = ProductListStore::instance()->active->get();
        if (empty($arActiveProductIDList) || empty($arElementIDList)) {
            return [];
        }

        $arResult = [];
        foreach ($arElementIDList as $iProductID => $iBrandID) {
            if (!in_array($iProductID, $arActiveProductIDList)) {
                continue;
            }

            $arResult[] = $iBrandID;
        }

        $arResult = array_unique($arResult);

        return $arResult;
    }
706937
public function promo($iPromoBlockID)
    {
        $arResultIDList = ProductListStore::instance()->promo_block->get($iPromoBlockID);

        //Fire event, get additional product ID list
        $arEventDataList = Event::fire(PromoBlock::EVENT_GET_PRODUCT_LIST, $iPromoBlockID);
        if (empty($arEventDataList)) {
            return $this->intersect($arResultIDList);
        }

        //Process event data
        foreach ($arEventDataList as $arProductIDList) {
            if (empty($arProductIDList) || !is_array($arProductIDList)) {
                continue;
            }

            $arResultIDList = array_merge($arResultIDList, $arProductIDList);
        }

        $arResultIDList = array_unique($arResultIDList);

        return $this->intersect($arResultIDList);
    }
779743
public function getBrands($category, $limit = null)
    {
        $qb = $this->getQueryBuilder()
            ->select('DISTINCT b.id, b.name')
            ->innerJoin('c.products', 'p')
            ->innerJoin('p.brand', 'b')
            ->where('p.active = TRUE')
            ->andWhere('b.available = TRUE');

        if ($category->getFamily()) {
            // this is a category
            $qb->andWhere('c.parentCategory = :category')
                ->setParameter('category', $category);
        } else {
            // this is a subcategory
            $qb->andWhere('c = :category')
                ->setParameter('category', $category);
        }

        if (!is_null($limit)) {
            $qb->setMaxResults($limit);
        }

        return $qb->getQuery()
            ->getResult();
    }
748515
public function setProductId($product_id) {

        $this->checkInArray($product_id, GDAXConstants::$productIdValues);
        $this->product_id = $product_id;
        return $this;

    }
583841
public function actionRemove($productId)
    {
        if (!empty($productId)) {
            if (!Yii::$app->user->isGuest) {
                $model = FavoriteProduct::find()
                    ->where(['product_id' => $productId, 'user_id' => Yii::$app->user->id])->one();
                if (!empty($model)) {
                    $model->delete();
                    if (Yii::$app->request->isAjax) {
                        return Yii::t('shop', 'You have successfully deleted this product from favorites.');
                    }
                    else {
                        Yii::$app->session->setFlash('success', Yii::t('shop', 'You have successfully deleted this product from favorites.'));
                    }
                }
                else {
                    if (Yii::$app->request->isAjax) {
                        return Yii::t('shop', 'Error has occurred.');
                    }
                    else {
                        Yii::$app->session->setFlash('error', Yii::t('shop', 'Error has occurred.'));
                    }
                }
                return $this->redirect(Yii::$app->request->referrer);
            }
            throw new ForbiddenHttpException();
        }
        else throw new NotFoundHttpException();
    }
1201885
public function forFilterId($filterId)
    {
        $filter = $this->agenda->getFilter($filterId);
        if ($filter) {
            return $this->forFilter($filter);
        }

        return $this;
    }
460623
public function set($product_id, array $products)
    {
        $this->delete(array('product_id' => $product_id));

        $added = $count = 0;
        foreach ($products as $product) {

            $count++;

            $data = array(
                'product_id' => $product_id,
                'item_product_id' => $product['product_id']
            );

            if ($this->add($data)) {
                $added++;
            }
        }

        return $count && $added == $count;
    }
670248
public function prune($dealerProduct = null)
    {
        if ($dealerProduct) {
            $this->addUsingAlias(DealerProductTableMap::ID, $dealerProduct->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
277571
public function getBrandCollectionByAbstractIdProduct(int $idProductAbstract): BrandCollectionTransfer
    {
        /** @var \Orm\Zed\Brand\Persistence\FosBrand[] $brandEntities */
        $brandEntities = $this->getFactory()
            ->getBrandQuery()
            ->useFosBrandProductQuery()
                ->filterByFkProductAbstract($idProductAbstract)
            ->endUse()
            ->find();

        $brandCollectionTransfer = new BrandCollectionTransfer();
        $brandProductMapper = $this->getFactory()->createBrandProductMapper();

        foreach ($brandEntities as $brandEntity) {
            $brandCollectionTransfer->addBrand(
                $brandProductMapper->mapBrand($brandEntity, new BrandTransfer())
            );
        }

        return $brandCollectionTransfer;
    }
284998
public function getWishlistsForCustomer($customerId)
    {
        if ($customerId) {
            $collection = $this->wishlist->create()
                ->getCollection()
                ->addFieldToFilter('customer_id', $customerId)
                ->setOrder('updated_at', 'DESC')
                ->setPageSize(1);

            if ($collection->getSize()) {
                return $collection->getFirstItem();
            }
        }

        return false;
    }
1092427
private function filterStore($storeId = null)
    {
        if ($storeId !== null) {
            if (!is_array($storeId)) {
                $storeId = explode(',', $storeId);
            }
            $this->subscriptionCollection->addFieldToFilter('store_id', ['in' => $storeId]);
        }

        return $this;
    }
511680
public function deleteBrandProductRelations(int $idProductAbstract, array $brandIds): void
    {
        if (count($brandIds) === 0) {
            return;
        }

        $this->getFactory()
            ->getBrandProductQuery()
            ->filterByFkProductAbstract($idProductAbstract)
            ->filterByFkBrand_In($brandIds)
            ->delete();
    }