\Drupflare\Anachron\Drupal\Entity LegacyEntityInfo

Builds the Drupal 7 `entity_get_info()` array from Drupal 11 entity type definitions.

Only keys that map one to one are given. The callbacks Drupal 7 carried (load hook, uri callback, access callback) have no equivalent and are left out, so legacy code that tests for one finds it missing instead of calling something that is not the same thing. The exception is controller class: Drupal 7 set it on every type and contrib code passes it to class_implements() unguarded, so it names DrupalDefaultEntityController, a class whose methods all refuse.

Summary

Methods
Properties
Constants
__construct
get
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
describe
manager
bundles
displays
KEYS

Constant

KEYS

KEYS = ['id' => 'id', 'revision' => 'revision', 'bundle' => 'bundle', 'label' => 'label', 'language' => 'langcode', 'uuid' => 'uuid']

Properties

$manager

$manager : \Drupal\Core\Entity\EntityTypeManagerInterface

Type

EntityTypeManagerInterface

$bundles

$bundles : \Drupal\Core\Entity\EntityTypeBundleInfoInterface

Type

EntityTypeBundleInfoInterface

$displays

$displays : \Drupal\Core\Entity\EntityDisplayRepositoryInterface

Type

EntityDisplayRepositoryInterface

Methods

__construct()

__construct(\Drupal\Core\Entity\EntityTypeManagerInterface  $manager, \Drupal\Core\Entity\EntityTypeBundleInfoInterface  $bundles, \Drupal\Core\Entity\EntityDisplayRepositoryInterface  $displays) : mixed

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $manager
\Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundles
\Drupal\Core\Entity\EntityDisplayRepositoryInterface $displays

Returns

mixed —

get()

get(?string  $entity_type = null) : array<string,mixed>

Describes one entity type, or every type.

Parameters

?string $entity_type

Returns

array —

describe()

describe(\Drupal\Core\Entity\EntityTypeInterface  $type) : array<string,mixed>

Describes one entity type in the Drupal 7 shape.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $type

Returns

array —