By tim.plunkett on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
When writing an entity storage class, much of the error handling, hook invoking, and generic logic can be handled by the base class.
In order to facilitate that, there are now five new protected methods which are called by the base class at key points in order to delegate to your subclass, allowing you to avoid extra boilerplate, and prevent you from accidentally bypassing important parts of entity storage.
The new methods are:
// Called by create()
protected function doCreate($entity_class, array $values);
// Called by loadMultiple()
protected function doLoadMultiple(array $ids = NULL);
// Called by delete()
protected function doDelete($entities);
// Called by save()
protected function doSave($id, EntityInterface $entity);
protected function has($id, EntityInterface $entity);
Impacts:
Module developers