DrupalCon Dublin 2016: Entity validation: The kick-ass road to data integrity

In Drupal 7 there was only one viable solution to ensure that your entities had all the right data: Make it go through the form system one way or the other. Drupal 8 fixes this and I'm going to show you how.

This session will not focus on all the complex structures behind the entity validation system (e.g.: Typed Data API), but on how you as a developer can leverage entity validation to improve your module or site's data integrity.

We will mainly look at constraints (read: validators) and how they most commonly apply to entities. Then we will focus on how the Entity API uses the validation system and learn from it.

By the end of this session you should have learned what constraints are, how you can add them to your custom entity types and how you can leverage the validation system to make sure your entities have valid data.



Attendees should have some basic knowledge of the entity or field API in Drupal 8 and have preferably tried to write their own entity or field type, although the latter is not a requirement.

Drupal is a registered trademark of Dries Buytaert.