You are here

SchemaMovieHasPart.php in Schema.org Metatag 7

File

schema_movie/src/SchemaMovieHasPart.php
View source
<?php

/**
 * Provides a plugin for the 'schema_movie_has_part' meta tag.
 */
class SchemaMovieHasPart extends SchemaHasPartBase {

  /**
   * Generate a form element for this meta tag.
   */
  public function getForm(array $options = []) {
    $form = parent::getForm($options);

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

}

Classes

Namesort descending Description
SchemaMovieHasPart Provides a plugin for the 'schema_movie_has_part' meta tag.