lib/Persistence/Doctrine/Helper/PositionHelper.php
public function getNextPosition(array $conditions): int
    {
        $columnName = $conditions['column'];

        $query = $this->connection->createQueryBuilder();
        $query->select($this->connection->getDatabasePlatform()->getMaxExpression($columnName) . ' AS ' . $columnName)
            ->from($conditions['table']);

        $this->applyConditions($query, $conditions['conditions']);

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

        return (int) ($data[0][$columnName] ?? -1) + 1;
    }
public function getNextPosition(array $conditions): int
    {
        $columnName = $conditions['column'];

        $query = $this->connection->createQueryBuilder();
        $query->select($this->connection->getDatabasePlatform()->getMaxExpression($columnName) . ' AS ' . $columnName)
            ->from($conditions['table']);

        $this->applyConditions($query, $conditions['conditions']);

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

        return (int) ($data[0][$columnName] ?? -1) + 1;
    }
public function getNextPosition ( array $ conditions ) : int { $ columnName = $ conditions [ 'column' ] ; $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> select ( $ this -> connection -> getDatabasePlatform ( ) -> getMaxExpression ( $ columnName ) . ' AS ' . $ columnName ) -> from ( $ conditions [ 'table' ] ) ; $ this -> applyConditions ( $ query , $ conditions [ 'conditions' ] ) ; $ data = $ query -> execute ( ) -> fetchAll ( PDO :: FETCH_ASSOC ) ; return ( int ) ( $ data [ 0 ] [ $ columnName ] ?? - 1 ) + 1 ; }
Returns the next available position in the table.
Returns the next available position in the table .