You are here

public static function BrightcoveVideoForm::apiClientUpdateForm in Brightcove Video Connect 3.x

Same name and namespace in other branches
  1. 8.2 src/Form/BrightcoveVideoForm.php \Drupal\brightcove\Form\BrightcoveVideoForm::apiClientUpdateForm()
  2. 8 src/Form/BrightcoveVideoForm.php \Drupal\brightcove\Form\BrightcoveVideoForm::apiClientUpdateForm()

Ajax callback to update the player options list.

Parameters

array $form: An associative array containing the structure of the form.

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

Return value

\Drupal\Core\Ajax\AjaxResponse Ajax command response.

Overrides BrightcoveVideoPlaylistForm::apiClientUpdateForm

File

src/Form/BrightcoveVideoForm.php, line 285

Class

BrightcoveVideoForm
Form controller for Brightcove Video edit forms.

Namespace

Drupal\brightcove\Form

Code

public static function apiClientUpdateForm(array $form, FormStateInterface $form_state) {
  $response = parent::apiClientUpdateForm($form, $form_state);

  // Update profile field.
  $response
    ->addCommand(new ReplaceCommand('#' . $form['profile']['widget']['#ajax_id'], $form['profile']));

  // Update custom fields.
  $response
    ->addCommand(new ReplaceCommand('#' . $form['custom_fields']['#ajax_id'], $form['custom_fields']));
  return $response;
}