EntityUntranslatableFieldsConstraintValidator
class EntityUntranslatableFieldsConstraintValidator extends ConstraintValidator implements ContainerInjectionInterface (View source)
Validates the EntityChanged constraint.
Traits
Provides helper methods to detect changes in an entity object.
Properties
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
Methods
Returns an array of field names to skip when checking for changes.
Constructs an EntityUntranslatableFieldsConstraintValidator object.
Instantiates a new instance of this class.
{@inheritdoc}
Checks whether an entity has untranslatable field changes.
Details
protected string[]
getFieldsToSkipFromTranslationChangesCheck(ContentEntityInterface $entity)
Returns an array of field names to skip when checking for changes.
__construct(EntityTypeManagerInterface $entity_type_manager)
Constructs an EntityUntranslatableFieldsConstraintValidator object.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
validate($entity, Constraint $constraint)
{@inheritdoc}
protected bool
hasUntranslatableFieldsChanges(ContentEntityInterface $entity)
Checks whether an entity has untranslatable field changes.