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

@ -34,7 +34,7 @@ class TagsType extends AbstractType implements DataTransformerInterface
}
if (is_array($value)) {
$tags = array_map(fn(Tag $tag) => $tag->getName(), $value);
$tags = array_map(fn(Tag $tag) => $tag->name, $value);
} else {
return '';
}
@ -51,7 +51,8 @@ class TagsType extends AbstractType implements DataTransformerInterface
$tagEntity = $this->repository->findOneBy(['name' => $tag, 'user' => $user]);
if ($tagEntity === null) {
$tagEntity = new Tag();
$tagEntity->setName($tag)->setUser($user);
$tagEntity->name = $tag;
$tagEntity->user = $user;
// Validate the new Tag entity
$errors = $this->validator->validate($tagEntity);
@ -90,4 +91,4 @@ class TagsType extends AbstractType implements DataTransformerInterface
{
return TextType::class;
}
}
}