Change snip and tag entities to public columns

This commit is contained in:
Tim
2025-07-24 14:51:55 +02:00
parent 8226ac24d8
commit 074c1d8570
15 changed files with 70 additions and 225 deletions

View File

@@ -25,7 +25,7 @@ class SnipLoader implements LoaderInterface
public function getCacheKey(string $name): string
{
return $this->getFromKey($name)->getActiveVersion()->getId();
return $this->getFromKey($name)->activeVersion->getId();
}
public function isFresh(string $name, int $time): bool
@@ -58,4 +58,4 @@ class SnipLoader implements LoaderInterface
return $snip;
}
}
}

View File

@@ -56,8 +56,8 @@ class SnipTwigExtension extends AbstractExtension
$request = new SnipFilterRequest(SnipFilterRequest::VISIBILITY_ALL, tag: $tag);
$snips = $this->snipRepo->findByRequest($user, $request);
return array_map(fn(Snip $snip) => [
'id' => $snip->getId(),
'name' => $snip->getName(),
'id' => $snip->id,
'name' => $snip->name,
], $snips);
}
}
}