mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -28,146 +28,100 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
|
||||
/**
|
||||
* User.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="users")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
|
||||
*/
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['user' => User::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
|
||||
#[ORM\Table(name: 'users')]
|
||||
class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
protected ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $absenceStart = null;
|
||||
|
||||
/**
|
||||
* Array where SAML attributes's data are stored.
|
||||
*
|
||||
* @ORM\Column(type="json", nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: false)]
|
||||
private array $attributes = [];
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Civility::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Civility::class)]
|
||||
private ?Civility $civility = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Location::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Location::class)]
|
||||
private ?Location $currentLocation = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=150, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 150, nullable: true)]
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(
|
||||
* type="string",
|
||||
* length=150,
|
||||
* nullable=true,
|
||||
* unique=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 150, nullable: true, unique: true)]
|
||||
private ?string $emailCanonical = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $enabled = true;
|
||||
|
||||
/**
|
||||
* @var Collection<GroupCenter>
|
||||
*
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\GroupCenter",
|
||||
* inversedBy="users")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\GroupCenter::class, inversedBy: 'users')]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
|
||||
private Collection $groupCenters;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=200)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 200)]
|
||||
private string $label = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
* sf4 check: in yml was false by default !?
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] // sf4 check: in yml was false by default !?
|
||||
private bool $locked = true;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Center::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Center::class)]
|
||||
private ?Center $mainCenter = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Location::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Location::class)]
|
||||
private ?Location $mainLocation = null;
|
||||
|
||||
/**
|
||||
* @var Collection&Selectable<int, UserScopeHistory>
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity=UserScopeHistory::class,
|
||||
* mappedBy="user", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: UserScopeHistory::class, mappedBy: 'user', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
private Collection&Selectable $scopeHistories;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
|
||||
private string $password = '';
|
||||
|
||||
/**
|
||||
* @internal must be set to null if we use bcrypt
|
||||
*
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
|
||||
private ?string $salt = null;
|
||||
|
||||
/**
|
||||
* @var Collection&Selectable<int, UserJobHistory>
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity=UserJobHistory::class,
|
||||
* mappedBy="user", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: UserJobHistory::class, mappedBy: 'user', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
private Collection&Selectable $jobHistories;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 80)]
|
||||
private string $username = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(
|
||||
* type="string",
|
||||
* length=80,
|
||||
* unique=true,
|
||||
* nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 80, unique: true, nullable: true)]
|
||||
private ?string $usernameCanonical = null;
|
||||
|
||||
/**
|
||||
* The user's mobile phone number.
|
||||
*
|
||||
* @ORM\Column(type="phone_number", nullable=true)
|
||||
*
|
||||
* @PhonenumberConstraint()
|
||||
*/
|
||||
#[ORM\Column(type: 'phone_number', nullable: true)]
|
||||
private ?PhoneNumber $phonenumber = null;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user