-
-
Notifications
You must be signed in to change notification settings - Fork 741
Closed
Labels
Description
When using Symfony we often have entities like this:
<?php
namespace App\Entity\Site;
use App\Traits\TimestampableTrait;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity()]
class SomenEntity
{
use TimestampableTrait;
#[ORM\Column(type: Types::INTEGER)]
#[ORM\GeneratedValue]
#[ORM\Id]
#[Groups(['group1', 'group2', 'group3'])]
private ?int $id = null;
#[ORM\Column(type: Types::STRING)]
#[Groups(['group3', 'group1', 'group2'])]
private ?string $name = null;
#[ORM\Column(type: Types::BOOLEAN)]
#[Groups(['group3', 'group2', 'group1'])]
private ?bool $show = null;
// getter and setters ...
}Notice that the array of group in Groups are not always written in the same order.
Would you be interested with a rule like this ? A rule which order these groups by ASC or DESC
Reactions are currently unavailable