protected function checkFieldOverrides(EntityDef $def, array $fieldOverrides)
{
$extraFields = array_diff(array_keys($fieldOverrides), array_keys($def->getFieldDefs()));
if (!empty($extraFields)) {
throw new Exception("Field(s) not in " . $def->getEntityType() . ": '" . implode("', '", $extraFields) . "'");
}
}