public static function YamapsFieldType::propertyDefinitions in Yandex.Maps 8
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 FieldItemInterface::propertyDefinitions
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- src/
Plugin/ Field/ FieldType/ YamapsFieldType.php, line 116
Class
- YamapsFieldType
- Plugin implementation of the 'Yandex Map' field type.
Namespace
Drupal\yamaps\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['coords'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Coordinates'));
$properties['type'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Type of "Yandex Maps" object'));
$properties['placemarks'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Placemarks'));
$properties['lines'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Lines'));
$properties['polygons'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Polygons'));
$properties['hide'] = DataDefinition::create('integer')
->setLabel(new TranslatableMarkup('Placemarks'));
return $properties;
}