public static function count($tableNames, $whereClause = '')
    {
        $isOnlyOneTable = ((strpos($tableNames, ',') === false)
            && (stripos(trim($tableNames), ' JOIN ') === false));
        if ($isOnlyOneTable && self::tableHasColumnUid($tableNames)) {
            // Counting only the "uid" column is faster than counting *.
            $columns = 'uid';
        } else {
            $columns = '*';
        }

        $result = self::selectSingle(
            'COUNT(' . $columns . ') AS phpunit_counter',
            $tableNames,
            $whereClause
        );

        return (int)$result['phpunit_counter'];
    }
public static function count($tableNames, $whereClause = '')
    {
        $isOnlyOneTable = ((strpos($tableNames, ',') === false)
            && (stripos(trim($tableNames), ' JOIN ') === false));
        if ($isOnlyOneTable && self::tableHasColumnUid($tableNames)) {
            // Counting only the "uid" column is faster than counting *.
            $columns = 'uid';
        } else {
            $columns = '*';
        }

        $result = self::selectSingle(
            'COUNT(' . $columns . ') AS phpunit_counter',
            $tableNames,
            $whereClause
        );

        return (int)$result['phpunit_counter'];
    }
public static function count ( $ tableNames , $ whereClause = '' ) { $ isOnlyOneTable = ( ( strpos ( $ tableNames , ',' ) === false ) && ( stripos ( trim ( $ tableNames ) , ' JOIN ' ) === false ) ) ; if ( $ isOnlyOneTable && self :: tableHasColumnUid ( $ tableNames ) ) { // Counting only the "uid" column is faster than counting *. $ columns = 'uid' ; } else { $ columns = '*' ; } $ result = self :: selectSingle ( 'COUNT(' . $ columns . ') AS phpunit_counter' , $ tableNames , $ whereClause ) ; return ( int ) $ result [ 'phpunit_counter' ] ; }
Counts the number of matching records in the database for a particular
WHERE clause.

@param string $tableNames
comma-separated list of existing tables from which to count, can
also be a JOIN, must not be empty
@param string $whereClause
WHERE clause, may be empty

@return int the number of matching records, will be >= 0

@throws \Tx_Phpunit_Exception_Database if an error has occurred
Counts the number of matching records in the database for a particular WHERE clause .