How do I know what setSetting is suppose to be? I am creating a custom content entity and in the BaseFieldDefinitions, I am trying to create a field for assigning a user as the designated assigner and will follow up with a assignee. So far, the code has been pretty easy to follow and makes sense, except for setSetting.

Basically the field below works, but its copy and pasted from drupal console as boiler plate code. What I don't understand is the setSetting part. If I comment out -&gt;setSetting('target_type', 'user'), the field displays but no longer works. 

So my question is, how am I suppose to know, or figure out, that I should be typing in 'target_type' and value 'user'? I went through the API but haven't managed to find any references to this. And I don't understand the setSetting below it either, 'handler' = 'default. I can comment that out and it works fine. So what gives? 

How am I suppose to know what to set in the setSettings part? As I also noticed, not every field definition even has this.

$fields['assigner'] = BaseFieldDefinition::create('entity_reference')
  -&gt;setLabel(t('Assigner'))
  -&gt;setDescription('The person who will issue this Task.')
  -&gt;setRevisionable(TRUE)
  -&gt;setSetting('target_type', 'user')
  -&gt;setSetting('handler', 'default')
  -&gt;setTranslatable(TRUE)
  -&gt;setDisplayOptions('view', [
      'label' =&gt; 'hidden',
      'type' =&gt; 'author',
      'weight' =&gt; 0,
  ])
  -&gt;setDisplayOptions('form', [
      'type' =&gt; 'entity_reference_autocomplete',
      'weight' =&gt; 5,
      'settings' =&gt; [
          'match_operator' =&gt; 'CONTAINS',
          'size' =&gt; '60',
          'autocomplete_type' =&gt; 'tags',
          'placeholder' =&gt; '',
      ],
  ])
  -&gt;setDisplayConfigurable('form', TRUE)
  -&gt;setDisplayConfigurable('view', TRUE);
You can look at the source code of the corresponding field type class to get an idea of the available settings. 

target_type is something specific for an ER field

Base classes for field types provided in Drupal core

Almost all field types are derived from one of the above base classes, e.g. there are several number field types deriving from NumericItemBase

Custom field types are usually located in module_name/src/Plugin/Field/FieldType