Change snipConent entitie property to public

This commit is contained in:
Tim
2025-07-24 15:03:20 +02:00
parent 074c1d8570
commit a1ecaf0189
8 changed files with 40 additions and 136 deletions

View File

@@ -18,10 +18,10 @@ class SnipContentController extends AbstractController
#[Route('/compare/{to}/{from}', name: '_compare')]
public function compare(SnipContent $to, ?SnipContent $from = null): Response
{
$this->denyAccessUnlessGranted(SnipVoter::VIEW, $to->getSnip());
$this->denyAccessUnlessGranted(SnipVoter::VIEW, $to->snip);
if ($from === null) {
$from = $to->getParent();
$from = $to->parent;
}
$diff = MyersDiff::buildDiffLines(
@@ -30,8 +30,8 @@ class SnipContentController extends AbstractController
);
return $this->render('content/compare.html.twig', [
'snip' => $to->getSnip(),
'snip' => $to->snip,
'diff' => $diff,
]);
}
}
}

View File

@@ -33,7 +33,7 @@ class VersionController extends AbstractController
$this->denyAccessUnlessGranted(SnipVoter::EDIT, $snip);
$this->contentService->setVersion($snip, $version);
$this->addFlash('success', 'Snip version set to ' . $version->getId());
$this->addFlash('success', 'Snip version set to ' . $version->id);
return $this->redirectToRoute('snip_single', ['snip' => $snip->id]);
}
}