protected function getQueryCount($table, Condition $condition = null)
    {
        $builder = $this->newQueryBuilder($table)
            ->select($this->connection->getDatabasePlatform()->getCountExpression($this->getPrimaryKey()));

        return $this->convertBuilder($builder, $condition);
    }