Skip to content

Commit

Permalink
Added review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jan 13, 2024
1 parent 03b5b56 commit 2ea63d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core-bundle/src/Routing/Content/ContentUrlResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public function hasTargetUrl(): bool
return \is_string($this->content);
}

/**
* @return string An absolute URL.
*/
public function getTargetUrl(): string
{
if (!$this->hasTargetUrl()) {
Expand Down
1 change: 1 addition & 0 deletions core-bundle/src/Routing/ContentUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ private function getRouteKey(object $content): string
return sprintf('%s.%s', $content::getTable(), $content->{$content::getPk()});
}

// If the content is a Doctrine ORM entity, try using its identifier
try {
$metadata = $this->entityManager->getClassMetadata($content::class);
} catch (MappingException) {
Expand Down

0 comments on commit 2ea63d7

Please sign in to comment.