src/ShopBundle/objects/db/TShopManufacturer.class.php
public function GetNumberOfHitsForSearchCacheId($iShopSearchCacheId, $bApplyActiveFilter = false)
    {
        $iNumHits = 0;

        if ($bApplyActiveFilter) {
            $query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
               LEFT JOIN `shop_article_shop_category_mlt` ON `shop_article`.`id` = `shop_article_shop_category_mlt`.`source_id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopSearchCacheId)."'
                     AND `shop_article`.`shop_manufacturer_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                  ";
            $sFilter = TdbShop::GetActiveFilterString(TdbShopManufacturer::FILTER_KEY_NAME);
            if (!empty($sFilter)) {
                $query .= " AND {$sFilter}";
            }

            $query .= ' GROUP BY `shop_article`.`shop_manufacturer_id`';
        //        echo "<pre>".$query."</pre><br>";
        } else {
            $query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopSearchCacheId)."'
                     AND `shop_article`.`shop_manufacturer_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                GROUP BY `shop_article`.`shop_manufacturer_id`
                 ";
        }
        if ($row = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
            $iNumHits = $row['hits'];
        }

        return $iNumHits;
    }
public function GetNumberOfHitsForSearchCacheId($iShopSearchCacheId, $bApplyActiveFilter = false)
    {
        $iNumHits = 0;

        if ($bApplyActiveFilter) {
            $query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
               LEFT JOIN `shop_article_shop_category_mlt` ON `shop_article`.`id` = `shop_article_shop_category_mlt`.`source_id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopSearchCacheId)."'
                     AND `shop_article`.`shop_manufacturer_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                  ";
            $sFilter = TdbShop::GetActiveFilterString(TdbShopManufacturer::FILTER_KEY_NAME);
            if (!empty($sFilter)) {
                $query .= " AND {$sFilter}";
            }

            $query .= ' GROUP BY `shop_article`.`shop_manufacturer_id`';
        //        echo "<pre>".$query."</pre><br>";
        } else {
            $query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopSearchCacheId)."'
                     AND `shop_article`.`shop_manufacturer_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                GROUP BY `shop_article`.`shop_manufacturer_id`
                 ";
        }
        if ($row = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
            $iNumHits = $row['hits'];
        }

        return $iNumHits;
    }
public function GetNumberOfHitsForSearchCacheId ( $ iShopSearchCacheId , $ bApplyActiveFilter = false ) { $ iNumHits = 0 ; if ( $ bApplyActiveFilter ) { $ query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
               LEFT JOIN `shop_article_shop_category_mlt` ON `shop_article`.`id` = `shop_article_shop_category_mlt`.`source_id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ iShopSearchCacheId ) . "'
                     AND `shop_article`.`shop_manufacturer_id` = '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ this -> id ) . "'
                  " ; $ sFilter = TdbShop :: GetActiveFilterString ( TdbShopManufacturer :: FILTER_KEY_NAME ) ; if ( ! empty ( $ sFilter ) ) { $ query .= " AND {$sFilter}" ; } $ query .= ' GROUP BY `shop_article`.`shop_manufacturer_id`' ; //        echo "<pre>".$query."</pre><br>"; } else { $ query = "SELECT COUNT(DISTINCT `shop_search_cache_item`.`id`) AS hits
                    FROM `shop_search_cache_item`
              INNER JOIN `shop_article` ON `shop_search_cache_item`.`shop_article_id` = `shop_article`.`id`
                   WHERE `shop_search_cache_item`.`shop_search_cache_id` = '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ iShopSearchCacheId ) . "'
                     AND `shop_article`.`shop_manufacturer_id` = '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ this -> id ) . "'
                GROUP BY `shop_article`.`shop_manufacturer_id`
                 " ; } if ( $ row = MySqlLegacySupport :: getInstance ( ) -> fetch_assoc ( MySqlLegacySupport :: getInstance ( ) -> query ( $ query ) ) ) { $ iNumHits = $ row [ 'hits' ] ; } return $ iNumHits ; }
returns the number of search hits for a manufacturer.

@param int  $iShopSearchCacheId
@param bool $bApplyActiveFilter - set to true if you want to count only hits that match the current filter

@return int
returns the number of search hits for a manufacturer .