protected function getResultCount(Criterion $filter, array $languageFilter)
    {
        $query = $this->handler->createSelectQuery();

        $columnName = $this->handler->quoteColumn('id', 'ezcontentobject');
        $query
            ->select("COUNT( DISTINCT $columnName )")
            ->from($this->handler->quoteTable('ezcontentobject'))
            ->innerJoin(
                'ezcontentobject_version',
                'ezcontentobject.id',
                'ezcontentobject_version.contentobject_id'
            );

        $query->where(
            $this->getQueryCondition($filter, $query, $languageFilter)
        );

        $statement = $query->prepare();
        $statement->execute();

        return (int)$statement->fetchColumn();
    }