function EntityReferenceItem::getSettableValues

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()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::getSettableValues()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.