October 2017
Intermediate to advanced
566 pages
14h 31m
English
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 entities.
The service we use for querying entities is the entity.query service (QueryFactory). So, we can inject this into ...
Read now
Unlock full access