You are here

public static function SchemaHasPartTrait::hasPartProperties in Schema.org Metatag 8

Return an array of the unique properties for an object type.

Parameters

string $object_type: The type of object. Use an object name for properties specific to that object type. Use 'All' for general properties that apply to all objects.

Return value

array An array of all the unique properties for that type.

1 call to SchemaHasPartTrait::hasPartProperties()
SchemaHasPartTrait::hasPartForm in src/Plugin/metatag/Tag/SchemaHasPartTrait.php
Create the form element.

File

src/Plugin/metatag/Tag/SchemaHasPartTrait.php, line 164

Class

SchemaHasPartTrait
Schema.org HasPart trait.

Namespace

Drupal\schema_metatag\Plugin\metatag\Tag

Code

public static function hasPartProperties($object_type) {
  switch ($object_type) {
    case 'WebPageElement':
      return [
        'isAccessibleForFree' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "True or False, whether this element is accessible for free.",
        ],
        'cssSelector' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "List of class names of the parts of the web page that are not free, i.e. '.first-class', '.second-class'. Do NOT surround class names with quotation marks!",
        ],
      ];
    case 'Clip':
    case 'TVClip':
      return [
        'description' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "One of the following values:\n\n'trailer': A preview or advertisement of the work.\n\n'behind_the_scenes': A summary of the production of the work.\n\n'highlight': A contiguous scene from the work.",
        ],
        'timeRequired' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "Duration of the clip in ISO 8601 format, 'PT2M5S' (2min 5sec).",
        ],
        'potentialAction' => [
          'class' => 'SchemaActionBase',
          'form' => 'actionForm',
          'description' => "Watch action(s) for the clip.",
          'actions' => [
            'Action',
            'ConsumeAction',
            'WatchAction',
          ],
        ],
      ];
    case 'All':
      return [
        '@id' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "Globally unique @id of the thing, usually a url, used to to link other properties to this object.",
        ],
        'name' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "The name of the work.",
        ],
      ];
    default:
      return [];
  }
}