As the title already says, I am wondering how to load an ECK entity programatically using it's entity id. The documentation on the ECK project page doesn't provide any developer information on Drupal 8 yet.

I really hope someone can help me out here.

Comments

Anonymous’s picture

Vic Luijkx created an issue. See original summary.

Anonymous’s picture

Title: Programmatically loading ECK entity. » Programmatically load ECK entity.
Anonymous’s picture

Title: Programmatically load ECK entity. » Programmatically load ECK entity by id
Issue summary: View changes
melvinlouwerse’s picture

Not sure if you already found out but to load them by id you should be able to use

   $storage = Drupal::service('entity.manager')->getStorage([[eck type]]);
   $entity = $storage->load([[id]])

Probably you should use entity.type.manager since entity.manager is deprecated but this is the code how we use it in some behat tests.

xSDx’s picture

Status: Active » Needs review

Service is actually now entity_type.manager like example below:

$storage = Drupal::service('entity_type.manager')->getStorage('some_entity_type');
$entity = $storage->load('some_id_here');
tamerzg’s picture

Category: Feature request » Support request
Status: Needs review » Reviewed & tested by the community
jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.