You are here

public static function SchemaCreativeWorkTrait::creativeWorkProperties 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 SchemaCreativeWorkTrait::creativeWorkProperties()
SchemaCreativeWorkTrait::creativeWorkForm in src/Plugin/metatag/Tag/SchemaCreativeWorkTrait.php
Create the form element.

File

src/Plugin/metatag/Tag/SchemaCreativeWorkTrait.php, line 182

Class

SchemaCreativeWorkTrait
Schema.org CreativeWork trait.

Namespace

Drupal\schema_metatag\Plugin\metatag\Tag

Code

public static function creativeWorkProperties($object_type) {
  switch ($object_type) {
    case 'Book':
      return [
        'isbn' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "The ISBN of the book.",
        ],
        'bookEdition' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "The edition of the book.",
        ],
        'bookFormat' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "The format of the book (comma-separated), i.e. https://schema.org/Hardcover,https://schema.org/Paperback,https://schema.org/EBook",
        ],
        'author' => [
          'class' => 'SchemaPersonOrgBase',
          'form' => 'personOrgForm',
          'description' => "The author of the work.",
        ],
        'potentialAction' => [
          'class' => 'SchemaActionBase',
          'form' => 'actionForm',
          'description' => "Potential action for the work, like a ReadAction.",
          'actions' => [
            'Action',
            'ConsumeAction',
            'ReadAction',
          ],
        ],
      ];
    case 'CreativeWorkSeason':
    case 'TVSeason':
      return [
        'seasonNumber' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "The number of the season.",
        ],
      ];
    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.",
        ],
        'url' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "Absolute URL of the canonical Web page for the work.",
        ],
        'sameAs' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "Urls and social media links, comma-separated list of absolute URLs.",
        ],
        'datePublished' => [
          'class' => 'SchemaNameBase',
          'form' => '',
          'description' => "Publication date.",
        ],
      ];
    default:
      return [];
  }
}