@param array  $query
@param string $column Column to count by, PK or * by default.

@return int
197689
public function count(array $query = [], string $column = null): int
    {
        return $this->getSelector()->where($query)->count();
    }
477507
public function count(string $column = '*'): int
    {
        $count = $this->queryRelate->getQuery()->count($column);

        $this->resetQueryRelate();

        return $count;
    }
720931
def count(self, query):
        
        if self.manual:
            return self.total
        
        if isinstance(query, Select):
            q = query.with_only_columns([func.count()]).order_by(None).limit(None).offset(None)
            return do_(q).scalar()

        return query.count()
407070
public static function isIndexedArray(array $query)
    {
        if (empty($query) || !isset($query[0])) {
            return false;
        }

        return array_keys($query) === range(0, count($query) - 1);
    }
86991
public static function parseColumns($query, $columns)
    {
        if ($columns instanceof AnDomainResourceColumn) {
            return array($columns);
        }

        settype($columns, 'array');
        $array = array();
        foreach ($columns as $key => $column) {
            $result = strpos($column, ' ') !== false ? null : self::parseColumn($query, $column);
            $cols = $result['columns'];
            if (!isset($result['property'])) {
                $array[$key] = $column;
            } elseif (!is_array($cols)) {
                $array[$key] = $cols;
            } else {
                $key = 10000;
                foreach ($cols as $col) {
                    $array[$key++] = $col;
                }
            }
        }

        return $array;
    }
80083
public static function parseColumn($query, $column)
    {
        $repository = $query->getRepository();
        $description = $repository->getDescription();
        $parts = explode('.', $column, 2);
        $attribute = isset($parts[1]) ? $parts[1] : null;
        $result = array('columns' => null, 'property' => null);
        //don't check the parent properties
        if ($property = $description->getProperty($parts[0], false)) {
            if ($property->isAttribute()) {
                $result['property'] = $property;
                $result['columns'] = $property->getColumn();
            } elseif ($property->isRelationship()) {
                if ($property->isManyToOne()) {
                    //join the query for the belongs to relationship
                    $result['columns'] = $columns = $property->getColumns();
                    $result['property'] = $property;
                    if ($attribute && isset($columns[$attribute])) {
                        $result['columns'] = $columns[$attribute];
                    } elseif ($attribute) {
                        $result = self::_parseManyToOne($query, $property, $attribute);
                    }
                } elseif ($property->isManyToMany()) {
                    $result = self::_parseManyToMany($query, $property, $attribute);
                    if (!$attribute) {
                        $result['columns'] = array();
                    }
                } elseif ($property->isOneToMany()) {
                    $result = self::_parseOneToMany($query, $property, $attribute);
                }

                return $result;
            }
        } elseif (isset($query->link[$parts[0]])) {
            $query = $query->link[$parts[0]]['query'];
            $result = self::parseColumn($query, $parts[1]);
        }

        return $result;
    }
1277561
public function exec($query)
    {
        $stmt = $this->getWye()->makeStatement($query, []);

        $stmt->execute();

        return $stmt->rowCount() !== null ? $stmt->rowCount() : 0;
    }
1156762
public function count($column = '*')
    {
        if ($column != '*') {
            $column = '`' . $column . '`';
        }

        $sql = 'select count(' . $column . ') from `' . $this->table .'`';

        if ($this->where !== null) {
            $sql .= ' where ' . $this->where;

            $this->where = null;
        }

        $stmt = $this->connection->prepare($sql);

        $this->bind($stmt, $this->where_data_binding);

        $this->where_data_binding = [];

        $stmt->execute();

        $r = $stmt->fetchColumn();

        return (int) $r;
    }
825481
public function sum($column)
    {
        $this->compileWheres();
        $result = $this->query->sum($column);

        return $result;
    }
410198
public function getCountForPagination($columns = ['*'])
    {
        $result = $this->getBuilder()->getCountForPagination($columns);

        // Reset query builder
        $this->resetBuilder();

        return $result;
    }
504496
protected function columnCountForWhereClause($column)
    {
        if (is_array($this->wheres))
            return count(array_filter($this->wheres, function($where) use($column) {
                return $where['column'] == $column;
            }));
    }
1226043
public function getLimit(array $query = [])
    {
        if (isset($query['limit']) && is_numeric($query['limit']) && in_array($query['limit'], self::$limits)) {
            return (int) $query['limit'];
        }

        return self::DEFAULT_LIMIT;
    }
598670
public function count($column = '*', bool $distinct = false)
    {
        parent::count($column, $distinct);
        return $this->getColumnResult();
    }
307332
protected function countBindingsFromQuery(string $query)
    {
        preg_match_all($this->getBindingPattern(), $query, $matches);

        return count($matches[0] ?? []);
    }
718745
public function count($column = null){
		if($column === null){
			$this->performed || $this->run();
			return (int) $this->connection->getDriver()->getNumRows($this->resultSet);
		}
		return $this->aggregation("COUNT(:$column)");
	}
454505
public function count($column)
    {
        // Set a really hight limit
        $this->limit(pow(100, 3));

        // Select only the COUNT column and get
        $result = $this->select(['COUNT(' . $this->table . '.' . $column .') as count'])->get();

        // Reset
        $this->reset();

        // Return number of records
        return (count($result) === 1)? (int) reset($result)['count'] : count($result);
    }
757561
public function value($column)
    {
        $result = (array) $this->first([$column]);

        return count($result) > 0 ? reset($result) : null;
    }