mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-20 10:21:32 +00:00
Clean up helper method - simplify entity reference creation
Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
This commit is contained in:
parent
584966d7ad
commit
da456598d1
1 changed files with 3 additions and 4 deletions
|
|
@ -69,10 +69,9 @@ class PartDataTableHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
// For DTO, create a Part proxy for URL generation
|
// For DTO, create a Part proxy for URL generation
|
||||||
$partForUrl = $context;
|
$partForUrl = $context instanceof PartDTO
|
||||||
if ($context instanceof PartDTO) {
|
? $this->entityManager->getReference(Part::class, $context->getId())
|
||||||
$partForUrl = $this->entityManager->getReference(Part::class, $context->getId());
|
: $context;
|
||||||
}
|
|
||||||
|
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'<a href="%s">%s%s</a>',
|
'<a href="%s">%s%s</a>',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue