original_string: public function move($up)
      {
          $table = $this->getTableName();
  
          if ($up && ($this->position > 1)) {
              $this->position--;
              $this->app['redbean']->exec('UPDATE '.$table.' SET position = position + 1 WHERE position = ?', [$this->position]);
          } else if (!$up && ($this->position < $this->app['redbean']->count($table))) {
              $this->position++;
              $this->app['redbean']->exec('UPDATE '.$table.' SET position = position - 1 WHERE position = ?', [$this->position]);
          }
      }
code: public function move($up)
      {
          $table = $this->getTableName();
  
          if ($up && ($this->position > 1)) {
              $this->position--;
              $this->app['redbean']->exec('UPDATE '.$table.' SET position = position + 1 WHERE position = ?', [$this->position]);
          } else if (!$up && ($this->position < $this->app['redbean']->count($table))) {
              $this->position++;
              $this->app['redbean']->exec('UPDATE '.$table.' SET position = position - 1 WHERE position = ?', [$this->position]);
          }
      }
code_tokens: public function move ( $ up ) { $ table = $ this -> getTableName ( ) ; if ( $ up && ( $ this -> position > 1 ) ) { $ this -> position -- ; $ this -> app [ 'redbean' ] -> exec ( 'UPDATE ' . $ table . ' SET position = position + 1 WHERE position = ?' , [ $ this -> position ] ) ; } else if ( ! $ up && ( $ this -> position < $ this -> app [ 'redbean' ] -> count ( $ table ) ) ) { $ this -> position ++ ; $ this -> app [ 'redbean' ] -> exec ( 'UPDATE ' . $ table . ' SET position = position - 1 WHERE position = ?' , [ $ this -> position ] ) ; } }
docstring: Moves this model up or down in position
  
  @param bool $up Move way
  
  @return void
docstring_tokens: Moves this model up or down in position