Skip to content
Snippets Groups Projects

Issue #2570593: Allow entities to be subclassed using "bundle classes"

18 files
+ 482
59
Compare changes
  • Side-by-side
  • Inline

Files

@@ -214,7 +214,8 @@ protected function doLoadMultiple(array $ids = NULL) {
protected function doCreate(array $values) {
// Set default language to current language if not provided.
$values += [$this->langcodeKey => $this->languageManager->getCurrentLanguage()->getId()];
$entity = new $this->entityClass($values, $this->entityTypeId);
$entity_class = $this->getEntityClass();
$entity = new $entity_class($values, $this->entityTypeId);
return $entity;
}
Loading