attus/entity_base

Drupal Entity Base Module

Installs: 60

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:drupal-module

2.1 2022-01-07 12:04 UTC

This package is auto-updated.

Last update: 2024-05-07 17:32:54 UTC


README

Drupal 9-10 Entity Base Module

Maintenance GitHub license GitHub release GitHub issues

Apply for custom Content or Config Entity Types

src\Entity\CustomContenEntity.php:

 * @ContentEntityType(
 *   handlers = {
 *     "storage" = "Drupal\entity_base\ContentEntityBaseStorage",
 *   }
 * )

src\Entity\CustomConfigEntity.php:

 * @ConfigEntityType(
 *   handlers = {
 *     "storage" = "Drupal\entity_base\ConfigEntityBaseStorage",
 *   }
 * )

Load By UUID

$myContentEntity = \Drupal::entityTypeManager()->getStorage('custom_content_entity')->loadByUuid($uuid);
$myConfigEntity = \Drupal::entityTypeManager()->getStorage('custom_config_entity')->loadByUuid($uuid);

You are free to use this module without any restriction but without any warranty.