Count values

@param boolean $includeDuplicates Whether to include duplicate values count
@return integer
330477
public function count($includeDuplicates = true)
    {
        $target = $this->collection;

        if ($includeDuplicates !== true) {
            $target = array_unique($target);
        }

        return count($target);
    }
10417
public function getCount($where = [], $joinConditions = [], $prefix = 'u')
    {
        return $this->find($where, $prefix, true, $joinConditions);
    }
1250810
public static function count_templates($context, $includes) {
        $params = self::validate_parameters(self::count_templates_parameters(), array(
            'context' => $context,
            'includes' => $includes
        ));
        $context = self::get_context_from_params($params['context']);
        self::validate_context($context);

        return api::count_templates($context, $includes);
    }
995149
public function getMultiCount($collection, $column, array $values, array $extra = array())
	{
		$queryParts = ['SELECT COUNT(*) FROM', $collection, 'WHERE', "$column IN (?)"];

		foreach ($extra as $key => $extraValue) {
			$queryParts[] = "AND $key = ?";
		}

		$query = $this->createQueryFrom($queryParts);
		$query->setParameter(1, implode(',', $values));

		foreach ($extra as $key => $extraValue) {
			$query->setParameter($key + 2, $extraValue);
		}

		return $query->count();
	}
1327933
public function each(callable $sideEffect)
    {
        $count = 0;

        foreach ($this->value as $key => $value) {
            $count++;

            if ($sideEffect($value, $key, $this) === false) {
                return $count;
            }
        }

        return $count;
    }
294248
public function count($filters)
    {
        $where = $this->getQueryFilter($filters);
        $query = $this->getEntityManager()->createQuery('SELECT COUNT(m) FROM FulgurioLightCMSBundle:Media m' . $where);
        if (!empty($filters))
        {
            foreach ($filters as $filterKey => $filterValue)
            {
                $query->setParameter($filterKey, $filterValue);
            }
        }
        return $query->getSingleScalarResult();
    }
1188739
public function pageCount($onlyCompleted = false)
    {
        if ($onlyCompleted) {
            $count = 0;
            foreach ($this->data['pages'] as $page) {
                if ($page['completed']) {
                    $count++;
                }
            }
        } else {
            $count = \count($this->data['pages']);
        }
        return $count;
    }
308885
public function getCounts($countables = [])
    {
        $counts = new CountableResults;

        $strategies = $this->buildCountableStrategies();

        // determine which countables to count for
        $countables = ( ! empty($countables))
                        ?   array_intersect($this->getCountables(), $countables)
                        :   $this->getActiveCountables();

        foreach ($countables as $parameterName) {

            // should we skip it no matter what?
            if ($this->isCountableIgnored($parameterName)) continue;

            $strategy = isset($strategies[$parameterName]) ? $strategies[$parameterName] : null;

            // normalize the strategy so that we can call_user_func on it
            if (is_a($strategy, ParameterCounterInterface::class)) {

                $strategy = [ $strategy, 'count' ];

            } elseif (is_null($strategy)) {
                // default, let it be handled by applyParameter

                $strategy = [ $this, 'countParameter' ];

            } elseif ( ! is_callable($strategy)) {

                throw new ParameterStrategyInvalidException(
                    "Invalid counting strategy defined for parameter '{$parameterName}',"
                    . " must be ParameterFilterInterface, classname, callable or null"
                );
            }

            // start with a fresh query
            $query = $this->getCountableBaseQuery();

            // apply the filter while temporarily ignoring the current countable parameter,
            // unless it is forced to be included
            $includeSelf = in_array($parameterName, $this->includeSelfInCount);

            if ( ! $includeSelf) {
                $this->ignoreParameter($parameterName);
            }

            $this->apply($query);

            if ( ! $includeSelf) {
                $this->unignoreParameter($parameterName);
            }

            // retrieve the count and put it in the results
            $counts->put($parameterName, call_user_func_array($strategy, [$parameterName, $query, $this]));
        }

        return $counts;
    }
1251709
public static function getNumberOperands($includeSelector = false)
    {
        $values = array(
            self::OPERATOR_EQUAL,
            self::OPERATOR_GREATER_THAN,
            self::OPERATOR_GREATER_THAN_EQUAL,
            self::OPERATOR_LOWER_THAN,
            self::OPERATOR_LOWER_THAN_EQUAL,
        );

        if ($includeSelector) {
            $values[] = self::OPERAND_SELECTOR;
        }

        return $values;
    }
1094298
public function inserts(array $values): int
    {
        $params = [$this->name];
        foreach ($values as $name=>$pos) {
            $params[] = $pos[0];
            $params[] = $pos[1];
            $params[] = $name;
        }
        return intval($this->handle->rawCommand('geoadd', $params));
    }
492665
public function count($totalItems = true)
    {
        $items = $this->getCart();

        if (!$totalItems) {
            return $items->count();
        }

        $count = 0;

        foreach ($items as $row) {
            $count += $row->qty;
        }

        return $count;
    }
131276
public function count($beanType,$addSQL = '',$params = array()) {
		$sql = "SELECT count(*) FROM {$this->safeTable($beanType)} ";
		if ($addSQL!='') $addSQL = ' WHERE '.$addSQL; 
		return (int) $this->adapter->getCell($sql.$addSQL,$params);
	}
419621
protected static function hasIdKey(array &$includedData)
    {
        return \array_key_exists(JsonApiTransformer::ID_KEY, $includedData)
        && !empty($includedData[JsonApiTransformer::ID_KEY]);
    }
1213048
public function supports( $methods ) {
		$support = 0;
		$methods = (array)$methods;

		foreach ( $methods as $method ) {
			if ( method_exists( $this, $method ) ) {
				$support++;
				continue;
			}
		}

		return count( $methods ) === $support;
	}
1001785
public function all(bool $includeDeprecated = false): array {
        $result = [];
        foreach ($this->iterate($includeDeprecated) as $key => $value) {
            $result[$key] = $value;
        }
        return $result;
    }
735034
private function checkTable($table, $include, $exclude)
    {
        if(in_array($table, $exclude))
        {
            return false;
        }

        return !isset($include[0]) || in_array($table, $include);
    }
440469
public function getMultiCount($collection, $column, array $values, array $extra = [])
    {
        $builder = $this->em->createQueryBuilder();

        $builder->select('count(e)')->from($collection, 'e');
        $builder->where($builder->expr()->in(":{$column}", ":{$column}"));

        foreach ($extra as $key => $extraValue) {
            $builder->andWhere("e.{$key} = :{$key}");
        }

        $query = $builder->getQuery();
        $query->setParameter($column, $values);

        foreach ($extra as $key => $extraValue) {
            $query->setParameter($key, $extraValue);
        }

        return $query->presence();
    }