/* (non-PHPdoc)
@see Countable::count()
339400
public function count() {
		$num = count($this->elements);
		if ($this->inheritedCollection !== null) {
			$num += $this->inheritedCollection->count();
		}
		return $num;
	}
860176
public function count()
    {
        if (!isset($this->count)) {
            $this->count = $this->repository->count($this->query);
        }
        return $this->count;
    }
149864
public static function count($criteria = array())
    {
        self::processCriteriaWithType($criteria);
        $count = self::connection()->count(self::collectionName(), $criteria);
        return $count;
    }
531474
public function count($count = null)
    {
        if ($count === null) {
            return isset($this->options['count']) ? $this->options['count'] : 0;
        } else {
            $this->options['count'] = $count;
            return $this;
        }
    }
591465
public static function count($data = false) {

        if ($data && Validate::isArray($data)) {

            return count($data);
        } else if ($data && Validate::isObject($data)) {

            return count(get_object_vars($data));
        }

        return 0;
    }
416300
public function count()
    {
        if(is_null($this->int_count)){
            $this->int_count = mb_strlen($this->value, C::ENCODING);
        }

        return $this->int_count;
    }
1064185
public function count()
    {
        if (isset($this->_resultset)) {
            return $this->_resultset->count();
        } elseif (isset($this->_limit) || isset($this->_group)) {
            return $this->execute()->count();
        } else {
            $query = clone $this;

            return (int)$query->select("count(*) count")->execute()->scalar();
        }
    }
539046
public function makeCountable(Data $data): ?CountableFormat
    {
        if (!$data->isCountable()) {
            return null;
        }

        return CountableFormat::make($data);
    }
614605
public function count()
    {
        if ($this->count == null) {
            $this->count = $this->itemProvider->count($this->method, $this->criterias());
        }

        return $this->count;
    }
1099408
public static function count()
    {
        $memoryTableAnnotation = ModelManager::getAnnotation(static::class, MemoryTable::class);
        if(null === $memoryTableAnnotation)
        {
            return null;
        }
        return MemoryTableManager::count($memoryTableAnnotation->name);
    }
681549
public function count($conditions = null, $values = [])
    {
        $res = $this->executeQuery('COUNT(' . $this->key . ') AS num', $conditions, $values)
            ->fetch();
        return (isset($res->num) ? (int)$res->num : 0);
    }
819995
public function count()
    {
        if ($this->counterOwner instanceof ParamsHolder) {
            return $this->counterOwner->params[$this->counterParam];
        } else {
            return ArrayHelper::getValue($this->counterOwner, $this->counterParam, 0);
        }
    }
1180562
public function count($key)
    {
        if ($this->has($key)) {
            if (\is_array($this->get($key))) {
                return \count($this->get($key));
            }

            return 1;
        }

        return 0;
    }
655966
public function count($params) {
        $orm = !is_null($params['ormObject']) ? $params['ormObject'] : ORM::for_table($params['table']);

        return $orm->count();
    }
1374676
final public function count()
    {
        if(!isset($this->_count))
        {
            $context = $this->getContext();
            $context->count = null;

            if ($this->invokeCommand('before.count', $context) !== false)
            {
                $context->count = $this->_actionCount($context);
                $this->invokeCommand('after.count', $context);
            }

            $this->_count = KObjectConfig::unbox($context->count);
        }

        return $this->_count;
    }
439203
public function count($arg = null)
    {
        if (is_null($arg)) {
            $arg = '*';
        }

        return $this->expr('count([count])')->setCustom('count', $this->bt($arg));
    }
332934
public function count($field = '*')
    {
        $copy = clone $this;

        $copy->_limit = null;
        $copy->_offset = null;
        $copy->_order = null;
        $copy->_aggregate['count'] = ['$sum' => 1];
        $r = $copy->execute();

        return $r ? $r[0]['count'] : 0;
    }