src/Entity/Account/CustomerProfilePreference.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Account;
  3. use App\Entity\Location\Station;
  4. use App\Entity\Service;
  5. use App\Entity\User;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. #[ORM\Table(name: 'customer_profile_preferences')]
  11. #[ORM\Entity]
  12. class CustomerProfilePreference
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\Column(name: 'id', type: 'integer')]
  16.     #[ORM\GeneratedValue(strategy: 'AUTO')]
  17.     protected int $id;
  18.     #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: true)]
  19.     #[ORM\OneToOne(targetEntity: User::class)]
  20.     protected ?Customer $user;
  21.     #[ORM\Column(name: 'min_age', type: 'smallint', nullable: true)]
  22.     protected ?int $minAge;
  23.     #[ORM\Column(name: 'max_age', type: 'smallint', nullable: true)]
  24.     protected ?int $maxAge;
  25.     #[ORM\Column(name: 'min_height', type: 'smallint', nullable: true)]
  26.     protected ?int $minHeight;
  27.     #[ORM\Column(name: 'max_height', type: 'smallint', nullable: true)]
  28.     protected ?int $maxHeight;
  29.     #[ORM\Column(name: 'min_breast_size', type: 'smallint', nullable: true)]
  30.     protected ?int $minBreastSize;
  31.     #[ORM\Column(name: 'max_breast_size', type: 'smallint', nullable: true)]
  32.     protected ?int $maxBreastSize;
  33.     /** @var int[] */
  34.     #[ORM\Column(name: 'nationality', type: 'simple_array', nullable: true)]
  35.     protected ?array $nationalities;
  36.     /** @var int[] */
  37.     #[ORM\Column(name: 'body_type', type: 'simple_array', nullable: true)]
  38.     protected ?array $bodyTypes;
  39.     /** @var int[] */
  40.     #[ORM\Column(name: 'hair_color', type: 'simple_array', nullable: true)]
  41.     protected ?array $hairColors;
  42.     /** @var int[] */
  43.     #[ORM\Column(name: 'private_haircut', type: 'simple_array', nullable: true)]
  44.     protected ?array $privateHaircuts;
  45.     #[ORM\Column(name: 'has_tattoo', type: 'boolean', nullable: true)]
  46.     protected ?bool $hasTattoo;
  47.     #[ORM\Column(name: 'has_piercing', type: 'boolean', nullable: true)]
  48.     protected ?bool $hasPiercing;
  49.     /** @var Station[] */
  50.     #[ORM\JoinTable(name: 'customer_profile_preference_stations')]
  51.     #[ORM\JoinColumn(name: 'customer_profile_preference_id', referencedColumnName: 'id')]
  52.     #[ORM\InverseJoinColumn(name: 'customer_profile_preference_station_id', referencedColumnName: 'id')]
  53.     #[ORM\ManyToMany(targetEntity: Station::class)]
  54.     protected Collection $stations;
  55.     #[ORM\Column(name: 'min_price', type: 'smallint', nullable: true)]
  56.     protected ?int $minPrice;
  57.     #[ORM\Column(name: 'max_price', type: 'smallint', nullable: true)]
  58.     protected ?int $maxPrice;
  59.     /** @var Service[] */
  60.     #[ORM\JoinTable(name: 'customer_profile_preference_services')]
  61.     #[ORM\JoinColumn(name: 'customer_profile_preference_id', referencedColumnName: 'id')]
  62.     #[ORM\InverseJoinColumn(name: 'customer_profile_preference_service_id', referencedColumnName: 'id')]
  63.     #[ORM\ManyToMany(targetEntity: Service::class)]
  64.     protected Collection $services;
  65.     /** @var int[] */
  66.     #[ORM\Column(name: 'client_types', type: 'simple_array', nullable: true)]
  67.     protected ?array $clientTypes;
  68.     #[ORM\Column(name: 'has_friend', type: 'boolean', nullable: true)]
  69.     protected ?bool $hasFriend;
  70.     #[ORM\Column(name: 'attached_to_saloon', type: 'boolean', nullable: true)]
  71.     protected ?bool $attachedToSaloon;
  72.     #[ORM\Column(name: 'has_selfie', type: 'boolean', nullable: true)]
  73.     protected ?bool $hasSelfie;
  74.     #[ORM\Column(name: 'has_video', type: 'boolean', nullable: true)]
  75.     protected ?bool $hasVideo;
  76.     #[ORM\Column(name: 'has_comments', type: 'boolean', nullable: true)]
  77.     protected ?bool $hasComments;
  78.     #[ORM\Column(name: 'is_approved', type: 'boolean', nullable: true)]
  79.     protected ?bool $isApproved;
  80.     #[Gedmo\Timestampable(on: "update")]
  81.     #[ORM\Column(name: 'updated_at', type: 'datetimetz_immutable')]
  82.     protected \DateTimeImmutable $updatedAt;
  83.     public function __construct(Customer $user, ?int $minAge = null, ?int $maxAge = null, ?int $minHeight = null, ?int $maxHeight = null,
  84.         ?int $minBreastSize = null, ?int $maxBreastSize = null, ?int $nationality = null, ?int $bodyType = null, ?int $hairColor = null,
  85.         ?int $privateHaircut = null, ?bool $hasTattoo = null, ?bool $hasPiercing = null, ?array $stations = null,
  86.         ?int $minPrice = null, ?int $maxPrice = null, ?array $services = null, ?bool $hasFriend = null, ?bool $attachedToSaloon = null,
  87.         ?bool $hasSelfie = null, ?bool $hasVideo = null, ?bool $hasComments = null, ?bool $isApproved = null)
  88.     {
  89.         $this->user = $user;
  90.         $this->minAge = $minAge;
  91.         $this->maxAge = $maxAge;
  92.         $this->minHeight = $minHeight;
  93.         $this->maxHeight = $maxHeight;
  94.         $this->minBreastSize = $minBreastSize;
  95.         $this->maxBreastSize = $maxBreastSize;
  96.         $this->nationalities = $nationality;
  97.         $this->bodyTypes = $bodyType;
  98.         $this->hairColors = $hairColor;
  99.         $this->privateHaircuts = $privateHaircut;
  100.         $this->hasTattoo = $hasTattoo;
  101.         $this->hasPiercing = $hasPiercing;
  102.         $this->stations = new ArrayCollection($stations ?? []);
  103.         $this->minPrice = $minPrice;
  104.         $this->maxPrice = $maxPrice;
  105.         $this->services = new ArrayCollection($services ?? []);
  106.         $this->hasFriend = $hasFriend;
  107.         $this->attachedToSaloon = $attachedToSaloon;
  108.         $this->hasSelfie = $hasSelfie;
  109.         $this->hasVideo = $hasVideo;
  110.         $this->hasComments = $hasComments;
  111.         $this->isApproved = $isApproved;
  112.         $this->stations = new ArrayCollection();
  113.         $this->services = new ArrayCollection();
  114. //        $this->updatedAt = CarbonImmutable::now();
  115.     }
  116.     public function getId(): int
  117.     {
  118.         return $this->id;
  119.     }
  120.     public function getUser(): User
  121.     {
  122.         return $this->user;
  123.     }
  124.     public function getMinAge(): ?int
  125.     {
  126.         return $this->minAge;
  127.     }
  128.     public function setMinAge(?int $minAge): void
  129.     {
  130.         $this->minAge = $minAge;
  131.     }
  132.     public function getMaxAge(): ?int
  133.     {
  134.         return $this->maxAge;
  135.     }
  136.     public function setMaxAge(?int $maxAge): void
  137.     {
  138.         $this->maxAge = $maxAge;
  139.     }
  140.     public function getMinHeight(): ?int
  141.     {
  142.         return $this->minHeight;
  143.     }
  144.     public function setMinHeight(?int $minHeight): void
  145.     {
  146.         $this->minHeight = $minHeight;
  147.     }
  148.     public function getMaxHeight(): ?int
  149.     {
  150.         return $this->maxHeight;
  151.     }
  152.     public function setMaxHeight(?int $maxHeight): void
  153.     {
  154.         $this->maxHeight = $maxHeight;
  155.     }
  156.     public function getMinBreastSize(): ?int
  157.     {
  158.         return $this->minBreastSize;
  159.     }
  160.     public function setMinBreastSize(?int $minBreastSize): void
  161.     {
  162.         $this->minBreastSize = $minBreastSize;
  163.     }
  164.     public function getMaxBreastSize(): ?int
  165.     {
  166.         return $this->maxBreastSize;
  167.     }
  168.     public function setMaxBreastSize(?int $maxBreastSize): void
  169.     {
  170.         $this->maxBreastSize = $maxBreastSize;
  171.     }
  172.     public function getNationalities(): ?array
  173.     {
  174.         return $this->nationalities;
  175.     }
  176.     public function setNationalities(?array $nationalities): void
  177.     {
  178.         $this->nationalities = $nationalities;
  179.     }
  180.     public function getBodyTypes(): ?array
  181.     {
  182.         return $this->bodyTypes;
  183.     }
  184.     public function setBodyTypes(?array $bodyTypes): void
  185.     {
  186.         $this->bodyTypes = $bodyTypes;
  187.     }
  188.     public function getHairColors(): ?array
  189.     {
  190.         return $this->hairColors;
  191.     }
  192.     public function setHairColors(?array $hairColors): void
  193.     {
  194.         $this->hairColors = $hairColors;
  195.     }
  196.     public function getPrivateHaircuts(): ?array
  197.     {
  198.         return $this->privateHaircuts;
  199.     }
  200.     public function setPrivateHaircuts(?array $privateHaircuts): void
  201.     {
  202.         $this->privateHaircuts = $privateHaircuts;
  203.     }
  204.     public function isHasTattoo(): ?bool
  205.     {
  206.         return $this->hasTattoo;
  207.     }
  208.     public function setHasTattoo(?bool $hasTattoo): void
  209.     {
  210.         $this->hasTattoo = $hasTattoo;
  211.     }
  212.     public function isHasPiercing(): ?bool
  213.     {
  214.         return $this->hasPiercing;
  215.     }
  216.     public function setHasPiercing(?bool $hasPiercing): void
  217.     {
  218.         $this->hasPiercing = $hasPiercing;
  219.     }
  220.     /**
  221.      * @return Station[]
  222.      */
  223.     public function getStations(): Collection
  224.     {
  225.         return $this->stations;
  226.     }
  227.     /**
  228.      * @param Station[] $stations
  229.      */
  230.     public function setStations(array $stations): void
  231.     {
  232.         $this->stations = new ArrayCollection($stations);
  233.     }
  234.     public function getMinPrice(): ?int
  235.     {
  236.         return $this->minPrice;
  237.     }
  238.     public function setMinPrice(?int $minPrice): void
  239.     {
  240.         $this->minPrice = $minPrice;
  241.     }
  242.     public function getMaxPrice(): ?int
  243.     {
  244.         return $this->maxPrice;
  245.     }
  246.     public function setMaxPrice(?int $maxPrice): void
  247.     {
  248.         $this->maxPrice = $maxPrice;
  249.     }
  250.     /**
  251.      * @return Service[]
  252.      */
  253.     public function getServices(): Collection
  254.     {
  255.         return $this->services;
  256.     }
  257.     /**
  258.      * @param Service[] $services
  259.      */
  260.     public function setServices(array $services): void
  261.     {
  262.         $this->services = new ArrayCollection($services);
  263.     }
  264.     public function getClientTypes(): ?array
  265.     {
  266.         return $this->clientTypes;
  267.     }
  268.     public function setClientTypes(?array $clientTypes): void
  269.     {
  270.         $this->clientTypes = $clientTypes;
  271.     }
  272.     public function isHasFriend(): ?bool
  273.     {
  274.         return $this->hasFriend;
  275.     }
  276.     public function setHasFriend(?bool $hasFriend): void
  277.     {
  278.         $this->hasFriend = $hasFriend;
  279.     }
  280.     public function isAttachedToSaloon(): ?bool
  281.     {
  282.         return $this->attachedToSaloon;
  283.     }
  284.     public function setAttachedToSaloon(?bool $attachedToSaloon): void
  285.     {
  286.         $this->attachedToSaloon = $attachedToSaloon;
  287.     }
  288.     public function isHasSelfie(): ?bool
  289.     {
  290.         return $this->hasSelfie;
  291.     }
  292.     public function setHasSelfie(?bool $hasSelfie): void
  293.     {
  294.         $this->hasSelfie = $hasSelfie;
  295.     }
  296.     public function isHasVideo(): ?bool
  297.     {
  298.         return $this->hasVideo;
  299.     }
  300.     public function setHasVideo(?bool $hasVideo): void
  301.     {
  302.         $this->hasVideo = $hasVideo;
  303.     }
  304.     public function isHasComments(): ?bool
  305.     {
  306.         return $this->hasComments;
  307.     }
  308.     public function setHasComments(?bool $hasComments): void
  309.     {
  310.         $this->hasComments = $hasComments;
  311.     }
  312.     public function isApproved(): ?bool
  313.     {
  314.         return $this->isApproved;
  315.     }
  316.     public function setIsApproved(?bool $isApproved): void
  317.     {
  318.         $this->isApproved = $isApproved;
  319.     }
  320.     public function getUpdatedAt(): \DateTimeImmutable
  321.     {
  322.         return $this->updatedAt;
  323.     }
  324.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): void
  325.     {
  326.         $this->updatedAt = $updatedAt;
  327.     }
  328. }