protected function getDatabaseFieldMappings(ClassMetadata $cm)
{
$fieldMappings = [];
$fields = $cm->getFieldNames();
foreach ($fields as $field) {
$currentMapping = $cm->getFieldMapping($field);
$asserts = $this->getExtJSAssertMappings($cm, $field);
if ($currentMapping['fieldName'] == 'id') {
$currentMapping['fieldName'] = '@id';
$currentMapping['type'] = 'string';
}
$fieldMappings[] = ['name' => $currentMapping['fieldName'], 'type' => $this->getExtJSFieldMapping($currentMapping['type']), 'validators' => json_encode($asserts), 'persist' => $this->allowPersist($cm, $field)];
}
return $fieldMappings;
}