function OptionsProviderBase::getPossibleValues

Returns an array of possible values.

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

Parameters

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

Return value

array An array of possible values.

Overrides OptionsProviderInterface::getPossibleValues

1 call to OptionsProviderBase::getPossibleValues()
OptionsProviderBase::getSettableValues in src/TypedData/Options/OptionsProviderBase.php
Returns an array of settable values.

File

src/TypedData/Options/OptionsProviderBase.php, line 19

Class

OptionsProviderBase
Base class for options providers used in Rules actions and conditions.

Namespace

Drupal\rules\TypedData\Options

Code

public function getPossibleValues(AccountInterface $account = NULL) {
  // Flatten options firstly, because Possible Options may contain group
  // arrays.
  $flatten_options = OptGroup::flattenOptions($this->getPossibleOptions($account));
  return array_keys($flatten_options);
}