src/Entity/Profile/PersonParameters.php line 13

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by simpson <simpsonwork@gmail.com>
  4.  * Date: 2019-03-19
  5.  * Time: 17:35
  6.  */
  7. namespace App\Entity\Profile;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Embeddable]
  10. final class PersonParameters
  11. {
  12.     #[ORM\Column(name'gender'type'smallint'nullablefalseoptions: ['default' => 1])]
  13.     protected ?int $gender;
  14.     #[ORM\Column(name'age'type'smallint'nullabletrue)]
  15.     protected ?int $age;
  16.     #[ORM\Column(name'height'type'smallint'nullabletrue)]
  17.     protected ?int $height;
  18.     #[ORM\Column(name'weight'type'smallint'nullabletrue)]
  19.     protected ?int $weight;
  20.     #[ORM\Column(name'breast_size'type'smallint'nullabletrue)]
  21.     protected ?int $breastSize;
  22.     #[ORM\Column(name'breast_type'type'smallint'nullabletrue)]
  23.     protected ?int $breastType;
  24.     #[ORM\Column(name'cloth_size'type'smallint'nullabletrue)]
  25.     protected ?int $clothSize;
  26.     #[ORM\Column(name'shoes_size'type'smallint'nullabletrue)]
  27.     protected ?int $shoesSize;
  28.     #[ORM\Column(name'body_type'type'smallint'nullabletrue)]
  29.     protected ?int $bodyType;
  30.     #[ORM\Column(name'hair_color'type'smallint'nullabletrue)]
  31.     protected ?int $hairColor;
  32.     #[ORM\Column(name'private_haircut'type'smallint'nullabletrue)]
  33.     protected ?int $privateHaircut;
  34.     #[ORM\Column(name'nationality'type'smallint'nullabletrue)]
  35.     protected ?int $nationality;
  36.     #[ORM\Column(name'has_tattoo'type'boolean'nullabletrue)]
  37.     protected ?bool $hasTattoo;
  38.     #[ORM\Column(name'has_piercing'type'boolean'nullabletrue)]
  39.     protected ?bool $hasPiercing;
  40.     public function __construct(?int $gender, ?int $age, ?int $height, ?int $weight, ?int $breastSize, ?int $breastType, ?int $clothSize, ?int $shoesSize,
  41.         ?int $bodyType, ?int $hairColor, ?int $privateHaircut, ?int $nationality, ?bool $hasTattoo, ?bool $hasPiercing)
  42.     {
  43.         $this->gender $gender ?? Genders::FEMALE;
  44.         $this->age $age;
  45.         $this->height $height;
  46.         $this->weight $weight;
  47.         $this->breastSize $breastSize;
  48.         $this->breastType $breastType;
  49.         $this->clothSize $clothSize;
  50.         $this->shoesSize $shoesSize;
  51.         $this->bodyType $bodyType;
  52.         $this->hairColor $hairColor;
  53.         $this->privateHaircut $privateHaircut;
  54.         $this->nationality $nationality;
  55.         $this->hasTattoo $hasTattoo;
  56.         $this->hasPiercing $hasPiercing;
  57.         if(null == $gender)
  58.             $gender Genders::FEMALE;
  59.         if(false === array_search($gender, [Genders::FEMALEGenders::MALEGenders::TRANS]))
  60.             throw new \LogicException('Invalid gender type');
  61.         $this->gender $gender;
  62.     }
  63.     public function getGender(): int
  64.     {
  65.         return $this->gender;
  66.     }
  67.     public function setGender(int $gender): void
  68.     {
  69.         $this->gender $gender;
  70.     }
  71.     public function getAge(): ?int
  72.     {
  73.         return $this->age;
  74.     }
  75.     public function getHeight(): ?int
  76.     {
  77.         return $this->height;
  78.     }
  79.     public function getWeight(): ?int
  80.     {
  81.         return $this->weight;
  82.     }
  83.     public function getBreastSize(): ?int
  84.     {
  85.         return $this->breastSize;
  86.     }
  87.     public function getBreastType(): ?int
  88.     {
  89.         return $this->breastType;
  90.     }
  91.     public function getClothSize(): ?int
  92.     {
  93.         return $this->clothSize;
  94.     }
  95.     public function getShoesSize(): ?int
  96.     {
  97.         return $this->shoesSize;
  98.     }
  99.     public function getBodyType(): ?int
  100.     {
  101.         return $this->bodyType;
  102.     }
  103.     public function getHairColor(): ?int
  104.     {
  105.         return $this->hairColor;
  106.     }
  107.     public function getPrivateHaircut(): ?int
  108.     {
  109.         return $this->privateHaircut;
  110.     }
  111.     public function getNationality(): ?int
  112.     {
  113.         return $this->nationality;
  114.     }
  115.     public function hasTattoo(): ?bool
  116.     {
  117.         return $this->hasTattoo;
  118.     }
  119.     public function hasPiercing(): ?bool
  120.     {
  121.         return $this->hasPiercing;
  122.     }
  123. }