public static function queryCount(iCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null)
    {
        // Get the Query Statement
        try {
            $strQuery = static::buildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses,
                $mixParameterArray, true);
        } catch (Caller $objExc) {
            $objExc->incrementOffset();
            throw $objExc;
        }

        // Perform the Query and return the row_count
        $objDbResult = $objQueryBuilder->Database->query($strQuery);

        // Figure out if the query is using GroupBy
        $blnGrouped = false;

        if ($objOptionalClauses) {
            if ($objOptionalClauses instanceof iClause) {
                if ($objOptionalClauses instanceof Clause\GroupBy) {
                    $blnGrouped = true;
                }
            } else {
                if (is_array($objOptionalClauses)) {
                    foreach ($objOptionalClauses as $objClause) {
                        if ($objClause instanceof Clause\GroupBy) {
                            $blnGrouped = true;
                            break;
                        }
                    }
                } else {
                    throw new Caller('Optional Clauses must be a iClause object or an array of iClause objects');
                }
            }
        }

        if ($blnGrouped) // Groups in this query - return the count of Groups (which is the count of all rows)
        {
            return $objDbResult->countRows();
        } else {
            // No Groups - return the sql-calculated count(*) value
            $strDbRow = $objDbResult->fetchRow();
            return (integer)$strDbRow[0];
        }
    }