You are here

protected static function Dimension::_propertyDefinitions in Dimension 8

Same name and namespace in other branches
  1. 2.1.x src/Plugin/Field/FieldType/Dimension.php \Drupal\dimension\Plugin\Field\FieldType\Dimension::_propertyDefinitions()
  2. 2.0.x src/Plugin/Field/FieldType/Dimension.php \Drupal\dimension\Plugin\Field\FieldType\Dimension::_propertyDefinitions()
3 calls to Dimension::_propertyDefinitions()
Area::propertyDefinitions in src/Plugin/Field/FieldType/Area.php
Defines field item properties.
Length::propertyDefinitions in src/Plugin/Field/FieldType/Length.php
Defines field item properties.
Volume::propertyDefinitions in src/Plugin/Field/FieldType/Volume.php
Defines field item properties.

File

src/Plugin/Field/FieldType/Dimension.php, line 71

Class

Dimension

Namespace

Drupal\dimension\Plugin\Field\FieldType

Code

protected static function _propertyDefinitions(FieldStorageDefinitionInterface $field_definition, $fields) {
  $properties = array();
  $properties['value'] = DataDefinition::create('string')
    ->setLabel(t('Value'))
    ->setRequired(TRUE);
  foreach ($fields as $key => $label) {
    $properties[$key] = DataDefinition::create('string')
      ->setLabel($label)
      ->setRequired(TRUE);
  }
  return $properties;
}