protected function sortableUpdate()
    {
        $table = $this->getTableName();

        if (!$this->position || ($this->position && count($this->app['redbean']->find($table, 'position = ? AND id != ?', [$this->position, $this->id])))) {
            $position = $this->app['redbean']->getCell('SELECT position FROM '.$table.' ORDER BY position DESC LIMIT 1');
            $this->position = $position + 1;
        }
    }
protected function sortableUpdate()
    {
        $table = $this->getTableName();

        if (!$this->position || ($this->position && count($this->app['redbean']->find($table, 'position = ? AND id != ?', [$this->position, $this->id])))) {
            $position = $this->app['redbean']->getCell('SELECT position FROM '.$table.' ORDER BY position DESC LIMIT 1');
            $this->position = $position + 1;
        }
    }
protected function sortableUpdate ( ) { $ table = $ this -> getTableName ( ) ; if ( ! $ this -> position || ( $ this -> position && count ( $ this -> app [ 'redbean' ] -> find ( $ table , 'position = ? AND id != ?' , [ $ this -> position , $ this -> id ] ) ) ) ) { $ position = $ this -> app [ 'redbean' ] -> getCell ( 'SELECT position FROM ' . $ table . ' ORDER BY position DESC LIMIT 1' ) ; $ this -> position = $ position + 1 ; } }
RedBean update method
Automates position assigning

@return void
RedBean update method Automates position assigning