You are here

protected function PatternDataDefinition::getVariantsDefinition in UI Patterns 8

Get definition for 'variant' property.

Return value

\Drupal\Core\TypedData\ListDataDefinition Data definition instance.

File

src/TypedData/PatternDataDefinition.php, line 89

Class

PatternDataDefinition
Class PatternDefinition.

Namespace

Drupal\ui_patterns\TypedData

Code

protected function getVariantsDefinition() {
  return new ListDataDefinition([], MapDataDefinition::create()
    ->setPropertyDefinition('name', $this
    ->getMachineNameDefinition()
    ->setRequired(TRUE))
    ->setPropertyDefinition('label', DataDefinition::create('string')
    ->setRequired(TRUE))
    ->setPropertyDefinition('description', DataDefinition::create('string')));
}