You are here

public static function VideoItem::propertyDefinitions in Video 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldType/VideoItem.php \Drupal\video\Plugin\Field\FieldType\VideoItem::propertyDefinitions()

Defines field item properties.

Properties that are required to constitute a valid, non-empty item should be denoted with \Drupal\Core\TypedData\DataDefinition::setRequired().

Return value

\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.

Overrides FileItem::propertyDefinitions

See also

\Drupal\Core\Field\BaseFieldDefinition

File

src/Plugin/Field/FieldType/VideoItem.php, line 104

Class

VideoItem
Plugin implementation of the 'video' field type.

Namespace

Drupal\video\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties = parent::propertyDefinitions($field_definition);

  // unset the default values from the file module
  unset($properties['display']);
  unset($properties['description']);
  $properties['data'] = DataDefinition::create('string')
    ->setLabel(t('Additional video metadata'))
    ->setDescription(t("Additional metadata for the uploadded or embedded video."));
  return $properties;
}