protected function createDefinition(Container $app, array $locales, array $crud, $name)
{
$label = array_key_exists('label', $crud) ? $crud['label'] : $name;
$localeLabels = $this->getLocaleLabels($locales, $crud);
$standardFieldLabels = ['id' => $app['translator']->trans('crudlex.label.id'), 'created_at' => $app['translator']->trans('crudlex.label.created_at'), 'updated_at' => $app['translator']->trans('crudlex.label.updated_at')];
$factory = $app->offsetExists('crud.entitydefinitionfactory') ? $app['crud.entitydefinitionfactory'] : new EntityDefinitionFactory();
$definition = $factory->createEntityDefinition($crud['table'], $crud['fields'], $label, $localeLabels, $standardFieldLabels, $this);
$this->configureDefinition($definition, $crud);
return $definition;
}