You are here

protected function PushBase::getFormValue in Open Social 8.9

Same name and namespace in other branches
  1. 8.7 modules/custom/activity_send/modules/activity_send_push_notification/src/PushBase.php \Drupal\activity_send_push_notification\PushBase::getFormValue()
  2. 8.8 modules/custom/activity_send/modules/activity_send_push_notification/src/PushBase.php \Drupal\activity_send_push_notification\PushBase::getFormValue()
  3. 10.3.x modules/custom/activity_send/modules/activity_send_push_notification/src/PushBase.php \Drupal\activity_send_push_notification\PushBase::getFormValue()
  4. 10.0.x modules/custom/activity_send/modules/activity_send_push_notification/src/PushBase.php \Drupal\activity_send_push_notification\PushBase::getFormValue()
  5. 10.1.x modules/custom/activity_send/modules/activity_send_push_notification/src/PushBase.php \Drupal\activity_send_push_notification\PushBase::getFormValue()
  6. 10.2.x modules/custom/activity_send/modules/activity_send_push_notification/src/PushBase.php \Drupal\activity_send_push_notification\PushBase::getFormValue()

Returns the submitted form value for a specific key.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

string|array $key: Values are stored as a multi-dimensional associative array. If $key is a string, it will return $values[$key]. If $key is an array, each element of the array will be used as a nested key. If $key = array('foo', 'bar') it will return $values['foo']['bar'].

mixed $default: (optional) The default value if the specified key does not exist.

Return value

mixed The value for the given key, or NULL.

File

modules/custom/activity_send/modules/activity_send_push_notification/src/PushBase.php, line 122

Class

PushBase
Class PushBase.

Namespace

Drupal\activity_send_push_notification

Code

protected function getFormValue(FormStateInterface $form_state, $key, $default = NULL) {
  if (!is_array($key)) {
    $key = [
      $key,
    ];
  }
  $key = array_merge([
    'push_notifications',
    $this
      ->getPluginId(),
  ], $key);
  return $form_state
    ->getValue($key, $default);
}