Validate that a column number falls within the set of columns for this matrix

@param $column
@return int
@throws Exception
508893
protected function validateColumnInRange($column)
    {
        $column = static::validateColumn($column);
        if ($column > $this->columns) {
            throw new Exception('Requested Column exceeds matrix size');
        }

        return $column;
    }
705795
public function isIdentity($column)
    {
        $this->_setupPrimaryKey();

        if (!isset($this->_metadata[$column])) {
            /**
             * @see Zend_Db_Table_Exception
             */
            // require_once 'Zend/Db/Table/Exception.php';

            throw new Zend_Db_Table_Exception('Column "' . $column . '" not found in table.');
        }

        return (bool) $this->_metadata[$column]['IDENTITY'];
    }
546208
public function count($columns = null)
    {
        $this->compileWheres();
        $result = $this->query->count();

        return (int) $result;
    }
1252287
protected function validateRowInRange($row)
    {
        $row = static::validateRow($row);
        if ($row > $this->rows) {
            throw new Exception('Requested Row exceeds matrix size');
        }

        return $row;
    }
1090879
public function max(string $column): int
    {
        $max = $this->queryRelate->getQuery()->max($column);

        $this->resetQueryRelate();

        return $max;
    }
86223
public function max(string $column = null)
    {
        if ($this->isNotEmpty()) {
            return max($this->toArray());
        }

        return false;
    }
880934
protected function parseSortColumn($column)
    {
        // Parse column specification, considering possible ansi sql quoting
        // Note that table prefix is allowed, but discarded
        if (preg_match('/^("?(?<table>[^"\s]+)"?\\.)?"?(?<column>[^"\s]+)"?(\s+(?<direction>((asc)|(desc))(ending)?))?$/i', $column, $match)) {
            $table = $match['table'];
            $column = $match['column'];
        } else {
            throw new InvalidArgumentException("Invalid sort() column");
        }
        return array($table, $column);
    }
1299953
protected function getValidColumns($columns)
    {
        $valid = array();
        foreach ($columns as $column) {
            if (!isset($this->data[$column])) {
                continue;
            }
            
            $valid[$column] = $this->data[$column];
        }
        
        return $valid;
    }
62286
public function of($column){
        ForUpdateOfImpl::of($this->context, $column);
        return new GetRule($this->context);
    }
552667
public Integer getInt(String column) {
		Number n = getNumber(column);
		return n != null ? n.intValue() : null;
	}
764377
public function getAutoIncrementValue(string $table, string $column = 'id')
    {
        $query = $this->connection->createQueryBuilder();
        $query->select($this->connection->getDatabasePlatform()->getMaxExpression($column) . ' AS id')
            ->from($table);

        $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        return (int) ($data[0]['id'] ?? 0) + 1;
    }
941027
public function fetchField($column)
    {
        if ($this->rowCount == 0) {
            throw new Exception('Empty result set');
        }
        $row = $this->current();
        if (!isset($this->columnOids[$column])) {
            throw new Exception("Field '$column' not found");
        }

        return $row[$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);
    }
375332
public function qualifyColumn($column)
    {
        if (Str::contains($column, '.')) {
            return $column;
        }

        $table = $this->getTable();

        if (Str::contains($table, ' as ')) {
            $table = explode(' as ', $table)[1];
        }

        return $table.'.'.$column;
    }
1285513
public function avg($column): int
    {
        $avg = $this->queryRelate->getQuery()->avg($column);

        $this->resetQueryRelate();

        return $avg;
    }
1114042
public function get($column): Column
    {
        if (!$this->exists($column)) {
            throw new Exception\ColumnNotFoundException(__METHOD__ . " Column '$column' not present in column model.");
        }

        return $this->columns->offsetGet($column);
    }
1152883
protected function column(Column $column) : ColumnExpr
    {
        return Expr::column($this->relatedTable->getName(), $column);
    }