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(
  41.         ?int $gender,
  42.         ?int $age,
  43.         ?int $height,
  44.         ?int $weight,
  45.         ?int $breastSize,
  46.         ?int $breastType,
  47.         ?int $clothSize,
  48.         ?int $shoesSize,
  49.         ?int $bodyType,
  50.         ?int $hairColor,
  51.         ?int $privateHaircut,
  52.         ?int $nationality,
  53.         ?bool $hasTattoo,
  54.         ?bool $hasPiercing
  55.     ) {
  56.         $this->gender $gender ?? Genders::FEMALE;
  57.         $this->age $age;
  58.         $this->height $height;
  59.         $this->weight $weight;
  60.         $this->breastSize $breastSize;
  61.         $this->breastType $breastType;
  62.         $this->clothSize $clothSize;
  63.         $this->shoesSize $shoesSize;
  64.         $this->bodyType $bodyType;
  65.         $this->hairColor $hairColor;
  66.         $this->privateHaircut $privateHaircut;
  67.         $this->nationality $nationality;
  68.         $this->hasTattoo $hasTattoo;
  69.         $this->hasPiercing $hasPiercing;
  70.         if (null == $gender)
  71.             $gender Genders::FEMALE;
  72.         if (false === array_search($gender, [Genders::FEMALEGenders::MALEGenders::TRANS]))
  73.             throw new \LogicException('Invalid gender type');
  74.         $this->gender $gender;
  75.     }
  76.     public function getGender(): int
  77.     {
  78.         return $this->gender;
  79.     }
  80.     public function setGender(int $gender): void
  81.     {
  82.         $this->gender $gender;
  83.     }
  84.     public function getAge(): ?int
  85.     {
  86.         return $this->age;
  87.     }
  88.     public function getHeight(): ?int
  89.     {
  90.         return $this->height;
  91.     }
  92.     public function getWeight(): ?int
  93.     {
  94.         return $this->weight;
  95.     }
  96.     public function getBreastSize(): ?int
  97.     {
  98.         return $this->breastSize;
  99.     }
  100.     public function getBreastType(): ?int
  101.     {
  102.         return $this->breastType;
  103.     }
  104.     public function getClothSize(): ?int
  105.     {
  106.         return $this->clothSize;
  107.     }
  108.     public function getShoesSize(): ?int
  109.     {
  110.         return $this->shoesSize;
  111.     }
  112.     public function getBodyType(): ?int
  113.     {
  114.         return $this->bodyType;
  115.     }
  116.     public function getHairColor(): ?int
  117.     {
  118.         return $this->hairColor;
  119.     }
  120.     public function getPrivateHaircut(): ?int
  121.     {
  122.         return $this->privateHaircut;
  123.     }
  124.     public function getNationality(): ?int
  125.     {
  126.         return $this->nationality;
  127.     }
  128.     public function hasTattoo(): ?bool
  129.     {
  130.         return $this->hasTattoo;
  131.     }
  132.     public function hasPiercing(): ?bool
  133.     {
  134.         return $this->hasPiercing;
  135.     }
  136. }