Release 2.18 (#4878)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Utils\Color;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -22,6 +23,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
#[ORM\ChangeTrackingPolicy('DEFERRED_EXPLICIT')]
|
||||
#[UniqueEntity('name')]
|
||||
#[Serializer\ExclusionPolicy('all')]
|
||||
#[Serializer\VirtualProperty('ColorSafe', exp: 'object.getColorSafe()', options: [new Serializer\SerializedName('color-safe'), new Serializer\Type(name: 'string'), new Serializer\Groups(['Default'])])]
|
||||
class Tag
|
||||
{
|
||||
/**
|
||||
@@ -95,4 +97,9 @@ class Tag
|
||||
{
|
||||
return $this->getName();
|
||||
}
|
||||
|
||||
public function getColorSafe(): string
|
||||
{
|
||||
return $this->getColor() ?? (new Color())->getRandom($this->getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,6 +298,9 @@ class User implements UserInterface, EquatableInterface, ThemeUserInterface, Pas
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 2.15
|
||||
*/
|
||||
#[Serializer\VirtualProperty]
|
||||
#[Serializer\SerializedName('apiToken')]
|
||||
#[Serializer\Groups(['Default'])]
|
||||
|
||||
Reference in New Issue
Block a user