Returns the auto increment value.

Returns the value used for autoincrement tables. Usually this will just
be null. In case for sequence based RDBMS, this method can return a
proper value for the given column.

@return mixed
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;
    }
759437
public function getValue() {
		// If we have five samples or fewer, fall back to a naive method.
		if ( $this->getCount() <= 5 ) {
			sort( $this->heights );
			$i = $this->p * count( $this->heights );
			if ( $i === floor( $i ) ) {
				return ( $this->heights[$i - 1] + $this->heights[$i] ) / 2;
			} else {
				return $this->heights[floor( $i )];
			}
		}

		return $this->heights[2];
	}
1038388
public function getPrevSibling()
    {
        // If parent and children are already loaded, avoid database query
        if($this->parent !== null && ($children = $this->parent->internalGetChildren()) !== null)
        {
            for($i=0; $i<count($children); $i++)
            {
                if($children[$i] == $this)
                {
                    return ($i-1 < 0) ? null : $children[$i-1];
                }
            }
        // @codeCoverageIgnoreStart
        }
        // @codeCoverageIgnoreEnd


        $qb = $this->getManager()->getConfiguration()->getBaseQueryBuilder();
        $alias = $this->getManager()->getConfiguration()->getQueryBuilderAlias();

        $qb->andWhere("$alias.".$this->getRightFieldName()." = :rgt1")
            ->setParameter('rgt1', $this->getLeftValue() - 1);
        if($this->hasManyRoots())
        {
            $qb->andWhere("$alias.".$this->getRootFieldName()." = :root")
                ->setParameter('root', $this->getRootValue());
        }

        $q = $qb->getQuery();
		if ($this->getManager()->getConfiguration()->isQueryHintSet()){
			$q = $this->getManager()->addHintToQuery($q);
		}
		$results = $q->getResult();

        if(!$results)
        {
            return null;
        }

        return $this->getManager()->wrapNode($results[0]);
    }
298414
public function getValue()
    {
        $from_input = $this
            ->grid
            ->getInputProcessor()
            ->getFilterValue('records_per_page');
        if ($from_input === null) {
            return $this->grid->getConfig()->getPageSize();
        } else {
            return (int) $from_input;
        }
    }
851481
public function getAutoIncrementValue(string $table, string $column = 'id')
    {
        $databaseServer = $this->connection->getDatabasePlatform()->getName();
        if (isset($this->databaseSpecificHelpers[$databaseServer])) {
            return $this->databaseSpecificHelpers[$databaseServer]
                ->getAutoIncrementValue($table, $column);
        }

        return 'null';
    }
265519
public function getOldValues()
    {
        return isset($this->table[count($this->table)-1]) ? $this->table[count($this->table)-1] : $this->value;
    }
927262
public function getRelated()
	{
		if($this->parent->getRawColumnValue($this->getForeignKey()) === null)
		{
			return false;
		}

		return $this->first();
	}
585261
public function getAutocompleteValue()
    {
        if (false === $this->isAutocomplete()) {
            return null;
        }
        return $this->getFilter(self::FILTER_AUTOCOMPLETE)[self::FILTER_AUTOCOMPLETE_VALUE];
    }
494569
protected function getValue()
    {
        // before get
        if (!$this->trigger(CachePool::EVENT_GET_BEFORE)) {
            $this->setHit(false);
            return null;
        }

        // get string value from the pool
        $this->strval = $this->pool->getDriver()->get($this->key);

        // after get
        if (!$this->trigger(CachePool::EVENT_GET_AFTER)) {
            $this->setHit(false);
            $this->set(null);
        }

        return $this->postGetValue();
    }
1120321
public function pkValue()
    {
        if ($args = func_get_args()) {
            !is_array($args[0]) || $args = array_shift($args);
            $args = array_values($args);
            foreach ($args as $key=>$arg)
                $this->{$this->_properties['primary_key'][$key]} = $arg;

            return $this;
        }

        $pk = array_intersect_key($this->_schema['values'],
            array_fill_keys($this->_properties['primary_key'], null));

        return count($pk)==0?null:(count($pk)==1?array_shift($pk):$pk);
    }
366928
static public int obtainNextIncrementInteger(Connection connection, ColumnData autoIncrementIntegerColumn) throws Exception {
		try {
			String sqlQuery = "SELECT nextval(?);";

			// Create SQL command
			PreparedStatement pstmt = null;
			{
				pstmt = connection.prepareStatement(sqlQuery);
				
				// Populate prepared statement
				pstmt.setString(1, autoIncrementIntegerColumn.getAutoIncrementSequence());
			}

			if( pstmt.execute() ) {
				ResultSet rs = pstmt.getResultSet();
				if( rs.next() ) {
					int nextValue = rs.getInt(1);
					
					return nextValue;
				} else {
					throw new Exception("Empty result returned by SQL: "+sqlQuery);
				}
				
			} else {
				throw new Exception("No result returned by SQL: "+sqlQuery);
			}
		} catch( Exception e ) {
			throw new Exception("Error while attempting to get a auto increment integer value for: "+
					autoIncrementIntegerColumn.getColumnName()+
					" ("+autoIncrementIntegerColumn.getAutoIncrementSequence()+")",e);
		}
	}
76822
public function getAutoIncrementPrimaryKey()
    {
        if ($this->getIdMethod() != IDMethod::NO_ID_METHOD) {
            $pks = $this->getPrimaryKey();
            foreach ($pks as $pk) {
                if ($pk->isAutoIncrement()) {
                    return $pk;
                }
            }
        }

        return null;
    }
263200
public function getInitialValue()
    {
        if ($this->hasDefaultValue) {
            return $this->defaultValue;
        }

        return $this->isNullable ? null : $this->dataType->getInitialValue();
    }
1002377
public function getSQL()
    {
        $val = $this->owner->get($this->short_name);
        if ($this->type == 'boolean') {
            $val = $this->getBooleanValue($val);
        }
        if ($val == ''
            && !$this->mandatory
            && ($this->listData || $this instanceof Field_Reference)
            && $this->type != 'boolean'
        ) {
            $val = null;
        }

        return $val;
    }
972240
protected function getMinValue()
    {
        $minValue = $this->getFilter()->getMinValue();

        if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
            $stepValue = $this->getStepValue();
            $minValue  = floor($minValue / $stepValue) * $stepValue;
        }

        return $minValue;
    }
97679
protected function getData()
    {
        if (is_null($this->order[0])) {
            return $this->table->data['data'];
        }

        $items  = $this->table->data['data'];
        $col    = $this->order[0];
        $order  = $this->order[1];

        usort($items, function ($a, $b) use ($col, $order) {
            if (!isset($a[$col]) && !isset($b[$col])) {
                return 0;
            }

            if (is_array($a[$col]) || is_array($b[$col])) {
                return 0;
            }

            if (!isset($a[$col]) || is_array($a[$col])) {
                return $order == 'asc' ? -1 : 1;
            }

            if (!isset($b[$col]) || is_array($b[$col])) {
                return $order == 'asc' ? 1 : -1;
            }

            return $order == 'asc'
                ? strnatcmp((string) $a[$col], (string) $b[$col])
                : strnatcmp((string) $b[$col], (string) $a[$col]);
        });

        return $items;
    }
195723
public function getNextId()
    {
        // remove any order prefixes from the last increment id
        $last = $this->_orderHelper->removeOrderIncrementPrefix($this->getLastId());
        // Using bcmath to avoid float/integer overflow.
        return $this->format(bcadd($last, 1));
    }