You are here

public function SchemaMovieHasPart::form in Schema.org Metatag 8

Generate a form element for this meta tag.

Overrides SchemaHasPartBase::form

File

schema_movie/src/Plugin/metatag/Tag/SchemaMovieHasPart.php, line 31

Class

SchemaMovieHasPart
Provides a plugin for the 'schema_movie_has_part' meta tag.

Namespace

Drupal\schema_movie\Plugin\metatag\Tag

Code

public function form(array $element = []) {
  $form = parent::form($element);

  // Limit potential actions to WatchAction.
  $form['potentialAction']['actionType']['#options'] = [
    'ConsumeAction' => 'ConsumeAction',
  ];
  $form['potentialAction']['ConsumeAction']['@type']['#options'] = [
    'WatchAction' => $this
      ->t('WatchAction'),
  ];
  return $form;
}