src/DataTransferObject/CreateUserRequest.php line 7

Open in your IDE?
  1. <?php
  2. namespace App\DataTransferObject;
  3. use Symfony\Component\Validator\Constraints as Assert;
  4. class CreateUserRequest
  5. {
  6.     /**
  7.      * @Assert\NotBlank
  8.      *
  9.      * @var string
  10.      */
  11.     protected $connexionId;
  12.     /**
  13.      * @Assert\NotBlank
  14.      * @Assert\Type(type="integer")
  15.      *
  16.      * @var int
  17.      */
  18.     protected $customerNumber;
  19.     /**
  20.      * @Assert\NotBlank
  21.      * @Assert\Email
  22.      *
  23.      * @var string
  24.      */
  25.     protected $email;
  26.     /**
  27.      * @var bool
  28.      */
  29.     protected $newsletter;
  30.     /**
  31.      * CreateUserRequest constructor.
  32.      */
  33.     public function __construct(
  34.         ?string $connexionId null,
  35.         ?int $customerNumber null,
  36.         ?string $email null,
  37.         bool $newsletter false
  38.     ) {
  39.         $this->connexionId $connexionId;
  40.         $this->customerNumber $customerNumber;
  41.         $this->email $email;
  42.         $this->newsletter $newsletter;
  43.     }
  44.     /**
  45.      * @return string
  46.      */
  47.     public function getConnexionId(): ?string
  48.     {
  49.         return $this->connexionId;
  50.     }
  51.     /**
  52.      * @return CreateUserRequest
  53.      */
  54.     public function setConnexionId(string $connexionId): self
  55.     {
  56.         $this->connexionId $connexionId;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return int
  61.      */
  62.     public function getCustomerNumber(): ?int
  63.     {
  64.         return $this->customerNumber;
  65.     }
  66.     /**
  67.      * @return CreateUserRequest
  68.      */
  69.     public function setCustomerNumber(int $customerNumber): self
  70.     {
  71.         $this->customerNumber $customerNumber;
  72.         return $this;
  73.     }
  74.     public function hasNewsletter(): bool
  75.     {
  76.         return $this->newsletter;
  77.     }
  78.     /**
  79.      * @return CreateUserRequest
  80.      */
  81.     public function setNewsletter(bool $newsletter): self
  82.     {
  83.         $this->newsletter $newsletter;
  84.         return $this;
  85.     }
  86.     /**
  87.      * @return string
  88.      */
  89.     public function getEmail(): ?string
  90.     {
  91.         return $this->email;
  92.     }
  93.     /**
  94.      * @return CreateUserRequest
  95.      */
  96.     public function setEmail(string $email): self
  97.     {
  98.         $this->email $email;
  99.         return $this;
  100.     }
  101. }