original_string: protected function evalToolbarButtons()
      {
          $buttons = $this->getConfig('view[toolbarButtons]');
  
          if ($buttons === false) {
              return null;
          }
          elseif (is_string($buttons)) {
              return array_map('trim', explode('|', $buttons));
          }
          elseif (is_array($buttons)) {
              return $buttons;
          }
  
          if ($this->manageMode == 'pivot') {
              return ['add', 'remove'];
          }
  
          switch ($this->relationType) {
              case 'hasMany':
              case 'morphMany':
              case 'morphToMany':
              case 'morphedByMany':
              case 'belongsToMany':
                  return ['create', 'add', 'delete', 'remove'];
  
              case 'hasOne':
              case 'morphOne':
              case 'belongsTo':
                  return ['create', 'update', 'link', 'delete', 'unlink'];
          }
      }
code: protected function evalToolbarButtons()
      {
          $buttons = $this->getConfig('view[toolbarButtons]');
  
          if ($buttons === false) {
              return null;
          }
          elseif (is_string($buttons)) {
              return array_map('trim', explode('|', $buttons));
          }
          elseif (is_array($buttons)) {
              return $buttons;
          }
  
          if ($this->manageMode == 'pivot') {
              return ['add', 'remove'];
          }
  
          switch ($this->relationType) {
              case 'hasMany':
              case 'morphMany':
              case 'morphToMany':
              case 'morphedByMany':
              case 'belongsToMany':
                  return ['create', 'add', 'delete', 'remove'];
  
              case 'hasOne':
              case 'morphOne':
              case 'belongsTo':
                  return ['create', 'update', 'link', 'delete', 'unlink'];
          }
      }
code_tokens: protected function evalToolbarButtons ( ) { $ buttons = $ this -> getConfig ( 'view[toolbarButtons]' ) ; if ( $ buttons === false ) { return null ; } elseif ( is_string ( $ buttons ) ) { return array_map ( 'trim' , explode ( '|' , $ buttons ) ) ; } elseif ( is_array ( $ buttons ) ) { return $ buttons ; } if ( $ this -> manageMode == 'pivot' ) { return [ 'add' , 'remove' ] ; } switch ( $ this -> relationType ) { case 'hasMany' : case 'morphMany' : case 'morphToMany' : case 'morphedByMany' : case 'belongsToMany' : return [ 'create' , 'add' , 'delete' , 'remove' ] ; case 'hasOne' : case 'morphOne' : case 'belongsTo' : return [ 'create' , 'update' , 'link' , 'delete' , 'unlink' ] ; } }
docstring: Determine the default buttons based on the model relationship type.
  @return string
docstring_tokens: Determine the default buttons based on the model relationship type .