mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -18,50 +18,40 @@ use Symfony\Component\Serializer\Annotation\Context;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="scopes")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
|
||||
*/
|
||||
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['scope' => Scope::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
|
||||
#[ORM\Table(name: 'scopes')]
|
||||
class Scope
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=false, options={"default": true})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false, options: ['default' => true])]
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* translatable names.
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*
|
||||
* @Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
* @var Collection<RoleScope>
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\RoleScope",
|
||||
* mappedBy="scope")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\MainBundle\Entity\RoleScope::class, mappedBy: 'scope')]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
|
||||
private Collection $roleScopes;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user