This session is sponsored by Sevaa - thank you!
Before Drupal 8 the best (and sometimes the only) way ensure that the data in nodes was correct was to lean on the form API's validation. This meant a validation function that would only run when trying to save the form. It's a nightmare for anyone building an application with lots of moving pieces because at no time could you guarantee that the data was valid without writing additional processing.
Drupal 8 has introduced the new Entity Validation API to help solve this problem. Validation on an entity is now write once, use everywhere. This means your project or application can have enforceable business logic built right into the entities it uses.
In this session we will:
- Discuss and review existing uses of the API in Drupal 8 core
- Learn how to check the validity of entities
- Demonstrate adding constraints to custom and existing entity types
- Understand the writing of custom constraints
The session is targeted at users with some understanding/experience in writing Drupal 8 modules, but anyone with some knowledge of PHP should be able to follow along.