public function count()
    {
        $qb = $this->getLoadQuery()
            ->select('COUNT(' . $this->getAlias() . '.id) as count')
            ->resetQueryParts(['groupBy', 'join'])
        ;
        $result = $qb->execute()->fetchColumn(0);

        return (int) $result;
    }