original_string: protected function _move(Table $table, $id, $step = 1, $type = self::TYPE_UP)
      {
          $behaviors = $table->behaviors();
          if (!Arr::in('Tree', $behaviors->loaded())) {
              $behaviors->load('Tree');
          }
  
          $entity = $table->get($id);
  
          /** @var TreeBehavior $treeBehavior */
          $treeBehavior = $behaviors->get('Tree');
          $treeBehavior->setConfig('scope', $entity->get('id'));
  
          if ($table->{$type}($entity, $step)) {
              $this->Flash->success($this->_configRead('messages.success'));
          } else {
              $this->Flash->error($this->_configRead('messages.error'));
          }
  
          return $this->_redirect();
      }
code: protected function _move(Table $table, $id, $step = 1, $type = self::TYPE_UP)
      {
          $behaviors = $table->behaviors();
          if (!Arr::in('Tree', $behaviors->loaded())) {
              $behaviors->load('Tree');
          }
  
          $entity = $table->get($id);
  
          /** @var TreeBehavior $treeBehavior */
          $treeBehavior = $behaviors->get('Tree');
          $treeBehavior->setConfig('scope', $entity->get('id'));
  
          if ($table->{$type}($entity, $step)) {
              $this->Flash->success($this->_configRead('messages.success'));
          } else {
              $this->Flash->error($this->_configRead('messages.error'));
          }
  
          return $this->_redirect();
      }
code_tokens: protected function _move ( Table $ table , $ id , $ step = 1 , $ type = self :: TYPE_UP ) { $ behaviors = $ table -> behaviors ( ) ; if ( ! Arr :: in ( 'Tree' , $ behaviors -> loaded ( ) ) ) { $ behaviors -> load ( 'Tree' ) ; } $ entity = $ table -> get ( $ id ) ; /** @var TreeBehavior $treeBehavior */ $ treeBehavior = $ behaviors -> get ( 'Tree' ) ; $ treeBehavior -> setConfig ( 'scope' , $ entity -> get ( 'id' ) ) ; if ( $ table -> { $ type } ( $ entity , $ step ) ) { $ this -> Flash -> success ( $ this -> _configRead ( 'messages.success' ) ) ; } else { $ this -> Flash -> error ( $ this -> _configRead ( 'messages.error' ) ) ; } return $ this -> _redirect ( ) ; }
docstring: Move object in tree table.
  
  @param   Table $table
  @param   string $type
  @param   int $id
  @param   int $step
  @return  \Cake\Http\Response|null
docstring_tokens: Move object in tree table .