You are here

public function EntityReferenceItem::getSettableValues in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::getSettableValues()

Returns an array of settable values.

If the optional $account parameter is passed, then the array is filtered to values settable by the account.

Parameters

\Drupal\Core\Session\AccountInterface $account: (optional) The user account for which to filter the settable values. If omitted, all settable values are returned.

Return value

array An array of settable values.

Overrides OptionsProviderInterface::getSettableValues

1 call to EntityReferenceItem::getSettableValues()
EntityReferenceItem::getPossibleValues in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
Returns an array of possible values.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php, line 589

Class

EntityReferenceItem
Defines the 'entity_reference' entity field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public function getSettableValues(AccountInterface $account = NULL) {

  // Flatten options first, because "settable options" may contain group
  // arrays.
  $flatten_options = OptGroup::flattenOptions($this
    ->getSettableOptions($account));
  return array_keys($flatten_options);
}