Normalize resource name
This commit is contained in:
@@ -49,7 +49,7 @@ class VersionStateProvider implements ProviderInterface
|
||||
|
||||
private function getVersions(string $resource, int $resourceId)
|
||||
{
|
||||
$entity = $this->entityManager->find(sprintf("App\\Entity\\%s", $resource), $resourceId);
|
||||
$entity = $this->entityManager->find($this->resourceToEntity($resource), $resourceId);
|
||||
$logs = $this->versionRepository->getLogEntries($entity);
|
||||
|
||||
$versions = [];
|
||||
@@ -59,4 +59,9 @@ class VersionStateProvider implements ProviderInterface
|
||||
|
||||
return $versions;
|
||||
}
|
||||
|
||||
private function resourceToEntity(string $resource): string
|
||||
{
|
||||
return sprintf("App\\Entity\\%s", ucfirst(strtolower($resource)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user