You are here

protected function SchemaFactory::dataDefinitionFactory in Schemata 8

Creates the data definition object.

Parameters

string $entity_type: The entity type ID.

string $bundle: The bundle name.

Return value

\Drupal\Core\Entity\TypedData\EntityDataDefinition The data definition.

1 call to SchemaFactory::dataDefinitionFactory()
SchemaFactory::create in src/SchemaFactory.php
Assemble a schema object based on the requested entity type.

File

src/SchemaFactory.php, line 132

Class

SchemaFactory
Create an object of type Drupal\schemata\Schema\SchemaInterface.

Namespace

Drupal\schemata

Code

protected function dataDefinitionFactory($entity_type, $bundle) {
  $key = sprintf('entity:%s', $entity_type);
  if (!empty($bundle)) {
    $key .= ':' . $bundle;
  }
  return $this->typedDataManager
    ->createDataDefinition($key);
}