Change snip content text rebuilding to static, allowing a lot cleaner interface getting the lastest text

This commit is contained in:
Tim
2025-05-13 12:33:25 +02:00
parent 04b2037f2d
commit 62136a0ca0
7 changed files with 25 additions and 29 deletions

View File

@ -4,6 +4,7 @@ namespace App\Entity;
use App\Entity\Helpers\TrackedTrait;
use App\Repository\SnipRepository;
use App\Service\SnipContent\SnipContentService;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
@ -56,6 +57,11 @@ class Snip
return $this->name ?? '';
}
public function getActiveText(): string
{
return SnipContentService::rebuildText($this->getActiveVersion());
}
public function getId(): ?int
{
return $this->id;