Count number of items

@param  int | array count by property(ies)
@return int
544977
public function count($property = null) {
		if ($property === null) {
			return count($this->_map);
		}
		
		if (is_array($property)) {
			$reduceFunction = function(&$result, &$item) use($property) {
				foreach ($property as $part) {
					if (! isset($item[$part])) {
						return;
					}
				}
				
				return $result + 1;
			};
		} else {
			$reduceFunction = function(&$result, &$item) use($property) {
				if (isset($item[$property])) {
					return $result + 1;
				};
			};
		}
		
		return (int) array_reduce($this->_data, $reduceFunction, 0);
	}
913484
public function count( $conditions = array() )
	{
		$conditions	= $this->getConditionQuery( $conditions, FALSE, TRUE, TRUE );					//  render WHERE clause if needed, foreign cursored, allow functions
		$conditions	= $conditions ? ' WHERE '.$conditions : '';
		$query	= 'SELECT COUNT(`%s`) as count FROM %s%s';
		$query	= sprintf( $query, $this->primaryKey, $this->getTableName(), $conditions );
		return (int) $this->dbc->query( $query )->fetch( \PDO::FETCH_OBJ )->count;
	}
103671
public function count(array $query = []): int
    {
        //Create options?
        return $this->collection->count(
            array_merge($this->query, $query),
            ['skip' => $this->offset, 'limit' => $this->limit]
        );
    }
50024
public function count()
    {
        $c = 0;
        // Using Pimple::$values will return the Closures, so instead get the
        // values in the container via ArrayAccess.
        foreach ($this->keys() as $valueName) {
            if ($this[$valueName] instanceof Slot) {
                ++$c;
            }
        }
        return $c;
    }
1169406
public function count()
    {
        return $this->items !== null
            ? parent::count()
            : (int)current(
                static::db()->query(
                    (clone $this->selFromDbAllQuery())->count()
                )->fetch()
            );
    }
1199238
public static function count($where = null): int
    {
        $select = static::select();

        if ($where !== null) {
            if ($where instanceof Where) {
                $select->field('COUNT(*)', 'total');
                $select->where(clone $where);

            } else if (is_array($where)) {
                $select->field('COUNT(*)', 'total');
                foreach ($where as $field => $value) {
                    $select->where($field, $value);
                }

            } else if (!is_array(static::$primaryKey) && (is_numeric($where) || is_string($where))) {
                $select->field('COUNT(' . static::$primaryKey . ')', 'total');
                $select->where(static::$primaryKey, $where);

            }
        } else {
            $pk = is_string(static::$primaryKey) ? static::$primaryKey : '*';
            $select->field('COUNT(' . $pk . ')', 'total');
        }

        $results = $select->fetchAll();

        if (isset($results[0])) {
            $r = $results[0];
            if (array_key_exists('total', $r)) {
                return (int)$r['total'];
            } else {
                return 0;
            }
        } else {
            return 0;
        }
    }
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;
    }
1219681
public function countWhere($property, $value)
    {

        $count = 0;
        foreach ($this->objects as $key => $obj) {
            if ($obj->{$property} === $value) {
                $count++;
            }
        }
        return $count;
    }
339400
public function count() {
		$num = count($this->elements);
		if ($this->inheritedCollection !== null) {
			$num += $this->inheritedCollection->count();
		}
		return $num;
	}
1317556
public function get_item_count() {
        $data = $this->data;

        $count = 0;
        if (isset($data[Parser::INDEX_LISTS_LIST_ITEMS])) {
            foreach ($data[Parser::INDEX_LISTS_LIST_ITEMS] as $things) {
                if (preg_match('#/items/#', $things['value'])) {
                    $count++;
                }
            }
        }

        return $count;
    }
1024329
public function count( $where = 'all', $options = array() )
	{

		$dbr = wfGetDB( DB_SLAVE );

		if ( !is_array( $where ) && $where == 'all' ) {

			/* Fetch all entities */
			$collection = $dbr->select( static::$table,
				'id',
				array(),
				__METHOD__,
				$options
			);

		} else {

			/* Fetch conditional entities */
			$collection = $dbr->select( static::$table,
				'id',
				$where,
				__METHOD__,
				$options
			);

		}

		/* Check result */
		if ( !$collection ) return 0;

		$count = $dbr->numRows( $collection );

		return $count;

	}
330477
public function count($includeDuplicates = true)
    {
        $target = $this->collection;

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

        return count($target);
    }
156386
public function count()
    {
        return $this->list->count() +
            count($this->firstItems) +
            count($this->lastItems);
    }
1143659
public function process(array $items)
    {
        $total = count($items);
        for ($i = 1; $i < $total; $i++) {
            for ($j = 0; $j < $total - $i; $j++) {
                if (!$items[$j]->getDate() || !$items[$j + 1]->getDate()) {
                    continue;
                }
                if ($items[$j]->getDate()->getTimestamp() > $items[$j + 1]->getDate()->getTimestamp()) {
                    continue;
                }
                $aux = $items[$j + 1];
                $items[$j + 1] = $items[$j];
                $items[$j] = $aux;
            }
        }

        return $items;
    }
174977
public static int count(int[] array, int value) {
        int count = 0;
        for (int i = 0; i < array.length; i++) {
            if (array[i] == value) {
                count++;
            }
        }
        return count;
    }
440690
public function count() {
		if(!$this->initialized)
			$this->initialize();

		return count($this->elements) - count($this->toRemove) + count($this->toAdd);
	}
1098407
public function count()
    {
        $cls     = $this->_cls;
        $pk      = $cls::getPK();
        $builder = $this->_makeBuilderForAggregations(" count($pk) ");
        return $this->_executeAndReturnFirst($builder, $this->_vals);
    }