March 2019
Intermediate to advanced
580 pages
15h 3m
English
Configuration entity fields are not exposed to the TypedData API in terms of data definition. If you remember, though, we do have the configuration schema that describes the type of data that is considered valid in the entity. This is, for the moment, the extent to which we can validate configuration entities as they are not (yet) exposed to the constraint-validator system.
But before we conclude this chapter, let's quickly see how we can validate a configuration entity. Here is a quick example:
$config_entity = View::load('content');
$config_entity->set('status', 'not a boolean');
$typed_config_entity = ConfigEntityAdapter::createFromEntity($config_entity);
$violations = $typed_config_entity->validate();
The first ...
Read now
Unlock full access