kernel/classes/ezvatrule.php
static function fetchCountByCategory( $categories )
    {
        $db = eZDB::instance();

        $query = "SELECT COUNT(*) AS count FROM ezvatrule vr, ezvatrule_product_category vrpc " .
                 "WHERE vr.id=vrpc.vatrule_id AND ";

        if ( is_array( $categories ) )
        {
            $query .= $db->generateSQLINStatement( $categories, 'vrpc.product_category_id', false, false, 'int' );
        }
        else
        {
            $query .= "vrpc.product_category_id =" . (int) $categories;
        }

        $rows = $db->arrayQuery( $query );

        return $rows[0]['count'];
    }
static function fetchCountByCategory( $categories )
    {
        $db = eZDB::instance();

        $query = "SELECT COUNT(*) AS count FROM ezvatrule vr, ezvatrule_product_category vrpc " .
                 "WHERE vr.id=vrpc.vatrule_id AND ";

        if ( is_array( $categories ) )
        {
            $query .= $db->generateSQLINStatement( $categories, 'vrpc.product_category_id', false, false, 'int' );
        }
        else
        {
            $query .= "vrpc.product_category_id =" . (int) $categories;
        }

        $rows = $db->arrayQuery( $query );

        return $rows[0]['count'];
    }
static function fetchCountByCategory ( $ categories ) { $ db = eZDB :: instance ( ) ; $ query = "SELECT COUNT(*) AS count FROM ezvatrule vr, ezvatrule_product_category vrpc " . "WHERE vr.id=vrpc.vatrule_id AND " ; if ( is_array ( $ categories ) ) { $ query .= $ db -> generateSQLINStatement ( $ categories , 'vrpc.product_category_id' , false , false , 'int' ) ; } else { $ query .= "vrpc.product_category_id =" . ( int ) $ categories ; } $ rows = $ db -> arrayQuery ( $ query ) ; return $ rows [ 0 ] [ 'count' ] ; }
Fetch number of VAT rules referencing given product categories

@param $categories Category (single or list) to count VAT rules for.

@return int
Fetch number of VAT rules referencing given product categories