You are here

public function GroupMembership::getEntityReferenceSettings in Group 8

Returns a list of entity reference field settings.

This allows you to provide some handler settings for the entity reference field pointing to the entity that is to become group content. You could even change the handler being used, all without having to alter the bundle field settings yourself through an alter hook.

Return value

array An associative array where the keys are valid entity reference field setting names and the values are the corresponding setting for each key. Often used keys are 'target_type', 'handler' and 'handler_settings'.

Overrides GroupContentEnablerBase::getEntityReferenceSettings

File

src/Plugin/GroupContentEnabler/GroupMembership.php, line 84

Class

GroupMembership
Provides a content enabler for users.

Namespace

Drupal\group\Plugin\GroupContentEnabler

Code

public function getEntityReferenceSettings() {
  $settings = parent::getEntityReferenceSettings();
  $settings['handler_settings']['include_anonymous'] = FALSE;
  return $settings;
}