You are here

public function ConditionalFieldsHandlerBase::getConditionValues in Conditional Fields 4.x

Same name and namespace in other branches
  1. 8 src/ConditionalFieldsHandlerBase.php \Drupal\conditional_fields\ConditionalFieldsHandlerBase::getConditionValues()

Get values form the condition options.

Parameters

array $options: The condition options or the array of values.

Return value

mixed Values for triggering events.

Overrides ConditionalFieldsHandlersPluginInterface::getConditionValues

8 calls to ConditionalFieldsHandlerBase::getConditionValues()
DateList::statesHandler in src/Plugin/conditional_fields/handler/DateList.php
Executes states handler according to conditional fields settings.
DefaultStateHandler::statesHandler in src/Plugin/conditional_fields/handler/DefaultStateHandler.php
Executes states handler according to conditional fields settings.
EmailDefault::statesHandler in src/Plugin/conditional_fields/handler/EmailDefault.php
Executes states handler according to conditional fields settings.
OptionsButtons::checkBoxesHandler in src/Plugin/conditional_fields/handler/OptionsButtons.php
Return state for check boxes.
OptionsButtons::radioHandler in src/Plugin/conditional_fields/handler/OptionsButtons.php
Return state for radio.

... See full list

File

src/ConditionalFieldsHandlerBase.php, line 25

Class

ConditionalFieldsHandlerBase
Defines a base handler implementation that most handlers plugins will extend.

Namespace

Drupal\conditional_fields

Code

public function getConditionValues(array $options) {
  if (isset($options['values'])) {
    $value_data = $options['values'];
  }
  else {
    $value_data = $options;
  }
  if (is_array($value_data)) {
    $values = $value_data;
  }
  elseif (is_string($value_data)) {
    $values = preg_split("/[\r\n]+/g", $value_data);
  }
  else {
    $values = [];
  }
  return $values;
}