original_string: 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;
          }
      }
code: 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;
          }
      }
code_tokens: 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 ; } }
docstring: RedBean update method
  Automates position assigning
  
  @return void
docstring_tokens: RedBean update method Automates position assigning