original_string: protected function evalManageMode()
      {
          if ($mode = post(self::PARAM_MODE)) {
              return $mode;
          }
  
          if ($this->forceManageMode) {
              return $this->forceManageMode;
          }
  
          switch ($this->eventTarget) {
              case 'button-create':
              case 'button-update':
                  return 'form';
  
              case 'button-link':
                  return 'list';
          }
  
          switch ($this->relationType) {
              case 'belongsTo':
                  return 'list';
  
              case 'morphToMany':
              case 'morphedByMany':
              case 'belongsToMany':
                  if (isset($this->config->pivot)) {
                      return 'pivot';
                  }
                  elseif ($this->eventTarget == 'list') {
                      return 'form';
                  }
                  else {
                      return 'list';
                  }
  
              case 'hasOne':
              case 'morphOne':
              case 'hasMany':
              case 'morphMany':
                  if ($this->eventTarget == 'button-add') {
                      return 'list';
                  }
  
                  return 'form';
          }
      }
code: protected function evalManageMode()
      {
          if ($mode = post(self::PARAM_MODE)) {
              return $mode;
          }
  
          if ($this->forceManageMode) {
              return $this->forceManageMode;
          }
  
          switch ($this->eventTarget) {
              case 'button-create':
              case 'button-update':
                  return 'form';
  
              case 'button-link':
                  return 'list';
          }
  
          switch ($this->relationType) {
              case 'belongsTo':
                  return 'list';
  
              case 'morphToMany':
              case 'morphedByMany':
              case 'belongsToMany':
                  if (isset($this->config->pivot)) {
                      return 'pivot';
                  }
                  elseif ($this->eventTarget == 'list') {
                      return 'form';
                  }
                  else {
                      return 'list';
                  }
  
              case 'hasOne':
              case 'morphOne':
              case 'hasMany':
              case 'morphMany':
                  if ($this->eventTarget == 'button-add') {
                      return 'list';
                  }
  
                  return 'form';
          }
      }
code_tokens: protected function evalManageMode ( ) { if ( $ mode = post ( self :: PARAM_MODE ) ) { return $ mode ; } if ( $ this -> forceManageMode ) { return $ this -> forceManageMode ; } switch ( $ this -> eventTarget ) { case 'button-create' : case 'button-update' : return 'form' ; case 'button-link' : return 'list' ; } switch ( $ this -> relationType ) { case 'belongsTo' : return 'list' ; case 'morphToMany' : case 'morphedByMany' : case 'belongsToMany' : if ( isset ( $ this -> config -> pivot ) ) { return 'pivot' ; } elseif ( $ this -> eventTarget == 'list' ) { return 'form' ; } else { return 'list' ; } case 'hasOne' : case 'morphOne' : case 'hasMany' : case 'morphMany' : if ( $ this -> eventTarget == 'button-add' ) { return 'list' ; } return 'form' ; } }
docstring: Determine the management mode based on the relation type and settings.
  @return string
docstring_tokens: Determine the management mode based on the relation type and settings .