entity CRUD operations

entityManage - a helper function for CRUD (create/update/delete + list) entity actions

15 October 2025
Tired of writing verbose Drupal 8+ code just to load, save, or delete an entity? 😩 Streamline your development with a single, powerful helper function: entityManage().

This custom function acts as a versatile wrapper for all your entity operations (Create, Read, Update, Delete, and List). Load a single entity, update a taxonomy term by name, list all inactive users, or delete an entity by ID or properties—all with one clean line of code. Stop calling $entityTypeManager, $storage, loadByProperties, and save() repeatedly!