Returns number of casted votes.
@return int
434604
public function getVotesCount()
    {
        $votes = 0;
        foreach ($this->answers as $answer) {
            $votes += $answer->votes;
        }
        return $votes;
    }
153677
public function count(): int
    {
        $collection = $this->documentManager->getCollection($this->documentClass);

        return $collection->count($this->query);
    }
827829
public function count(): int
    {
        $this->flags['count'] = true;
        $pdoStatement = $this->provideStatement();
        $pdoStatement = $this->execute($pdoStatement);
        return $pdoStatement->fetchColumn();
    }
1064842
public function count() {
		$db = DBFactory::getDB($this->data['table']);
		$result = $db->count($this->data['table'], $this->data['where']);
		return intval($result);
	}
541975
public function voters()
    {
        $property = property_exists($this, 'vote') ? $this->vote : __CLASS__;

        return $this->morphToMany($property, 'votable', $this->vote_table ?: 'votes');
    }
1012750
public function getRatingCount()
    {
        if ($this->_iRatingCnt === null) {
            $this->_iRatingCnt = false;
            if ($this->isReviewActive() && ($oDetailsProduct = $this->getProduct())) {
                $blShowVariantsReviews = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVariantReviews');
                $this->_iRatingCnt = $oDetailsProduct->getArticleRatingCount($blShowVariantsReviews);
            }
        }

        return $this->_iRatingCnt;
    }
309152
public function count()
    {
        if ($this->_resultsCount === null) {
            $this->_resultsCount = $this->_performCount();
        }

        return $this->_resultsCount;
    }
408371
public function getNumChildren()
    {
        $db = Loader::db();
        $q = 'select count(*) as total from CollectionVersionBlocks where bID = ? and isOriginal = 0';
        $total = $db->getOne($q, [$this->getBlockID()]);

        return $total;
    }
1315656
public function count(): int
    {
        $amount = 0;
        // iterate with $key so the key consumer from peek() can have a look
        foreach ($this->elements as $key => $element) {
            $amount++;
        }

        return $amount;
    }
1015368
protected function countVote($toCount)
    {
        $value = 0;
        foreach ($this->votes as $login => $vote) {
            if ($vote === $toCount) {
                $value++;
            }
        }

        return $value;
    }
396143
public function getReviewAndRatingItemsCount()
    {
        $user = $this->getUser();
        $count = 0;
        if ($user) {
            $count = $this
                ->getContainer()
                ->get(UserReviewAndRatingBridgeInterface::class)
                ->getReviewAndRatingListCount($user->getId());
        }

        return $count;
    }
1330597
public function getCount () {
        if ($this->_count === null) {
            $this->_count = $this->getConnection ()->getSlave ()->scard ($this->name);
        }
        return $this->_count;
    }
1124096
def vote_count(self):
        
        return Vote.objects.filter(
            content_type=ContentType.objects.get(app_label='poll', model='polloption'),
            object_id__in=[o.id for o in self.polloption_set.all()]
        ).aggregate(Sum('vote'))['vote__sum'] or 0
815916
public function getCommentPopularity()
    {
        $total = $this->getLikes() + $this->getDislikes();
        if ($total) {
            $popularity = 100 * ($this->getLikes()
                            / ($this->getLikes() + $this->getDislikes()));
            return round($popularity);
        } else {
            return 0;
        }
    }
879414
public static function countAll () : int
	{
        $dbObject  	= Database::getInstance();
		$sqlQuery 	= "SELECT COUNT(*) FROM ".static::$tableName;
		$resultSet 	= $dbObject->query($sqlQuery);
		$row 		= Database::fetchAssoc($resultSet);
		return (int) array_shift($row);
	}
1294815
public function getNumComments()
    {
        $count = (new CommentManager())
            ->filter("article = %i", array($this->getId()))
            ->filter("active = 1")
            ->filter("spam = 0 ");

        $count = $count->values();

        $num = 0;

        if ($count) {
            foreach ($count as $item) {
                if ($item->isAccessible()) {
                    $num++;
                }
            }
        }

        return $num;
    }
176319
public function count()
    {
        $self         = clone $this;
        $self->type   = 'select';
        $self->select = ['COUNT(*) AS cnt'];
        $result       = $self->execute();
        return count($result[0]) > 0 ? (int) $result[0]['cnt'] : 0;
    }