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 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 and loading entities
One of the most common things you will do as a programmer is query for stuff, such as data in the database. This is what we were doing a lot in Drupal 7 to get our data. A lot. We'd either use the database API or simple query strings and load our data. However, in Drupal 8 the entity API has become much more robust and offers a layer that reduces the need to query the database directly. In a later chapter, we will see how to do that still for 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...