You are here

protected function PatternDataDefinition::getMachineNameDefinition in UI Patterns 8

Get valid machine name definition.

Return value

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

File

src/TypedData/PatternDataDefinition.php, line 63

Class

PatternDataDefinition
Class PatternDefinition.

Namespace

Drupal\ui_patterns\TypedData

Code

protected function getMachineNameDefinition() {
  return DataDefinition::create('string')
    ->addConstraint('Regex', sprintf(self::MACHINE_NAME, implode('|', $this->reserved)));
}