backdrop-issues
backdrop-issues copied to clipboard
[DX] [D8] Add a `validate()` method to entity classes
In Drupal 8, classes that are used in order to implement a content entity (which extend the ContentEntityBase
class) have a validate()
method that validates the values entered when creating the entity.
A similar method should be introduced in Backdrop and added to EntityInterface
.
This is probably a Backdrop 2.x feature. Contributed modules could have implemented a validate()
method in their entities that could be not compatible with the implementation Backdrop adds.
This is probably a Backdrop 2.x feature.
Agreed. This would be a fairly complex and deep change to the way Backdrop deals with entities and data in general (e.g. fields). It's not just about creating a validate
method for the entity class. The Drupal ContentEntityBase::validate()
method actually calls the validate method for the entity's "typed data" objects - for example, its fields and properties.