/**
* {@inheritdoc}
*/
protected function flagViolations(EntityConstraintViolationListInterface
$violations, array
$form, FormStateInterface
$form_state) { // Manually flag violations of fields not handled by the form display. This
// is necessary as entity form displays only flag violations for fields
// contained in the display.
$field_names =
[ 'label',
'id',
];
foreach ($violations->
getByFields($field_names) as $violation) { [$field_name] =
explode('.',
$violation->
getPropertyPath(), 2
);
$form_state->
setErrorByName($field_name,
$violation->
getMessage());
} parent::
flagViolations($violations,
$form,
$form_state);
} /**
* {@inheritdoc}
*/
public function save(array
$form, FormStateInterface
$form_state) { $workspace =
$this->entity;