Interacting with the Entity API
In this final section of the chapter, we’re going to cover the most common things you will be doing with content and configuration entities. These are the main topics we will discuss going forward:
- Querying and loading entities
- Reading entities
- Manipulating entities (update/save)
- Creating entities
- Rendering entities
- Validating entity data
So, let’s hit it.
Querying entities
One of the most common things you will do as a programmer is query stuff, such as data in the database. The Entity API offers a layer that reduces the need to query the database directly. In a later chapter, we will see how we can still do that when things become more complex. For now, since most of our structured data belongs in entities, we will use the entity query system for retrieving entities.
If you remember when we spoke about the entity type handlers, one of them was the storage handler that provides the API for CRUD...