In Drupal 7 core all the common objects, like nodes, users, comments, and terms, are called entities. Entities are a base level conceptual object designed to be used as a base for objects in core and contrib. But, there is a problem with the core entity pattern we can improve on in our contrib modules.
Entities have a controller used for their loading operations. The controller is a class that can be swapped out for alternative controllers when developers want to do something fancy, like have their own node caching setup. But, only the load operation is on the controller. The other CRUD (create, read, and delete) are hard coded in functions like node_load, node_save, and other object operations. The CRUD control for entities can't be completely swapped out. Let's take a look at a base pattern to use for completely swappable controllers. Read more »
Recent comments