<?php
/**
* Created by simpson <simpsonwork@gmail.com>
* Date: 2019-03-19
* Time: 17:35
*/
namespace App\Entity\Profile;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Embeddable]
final class PersonParameters
{
#[ORM\Column(name: 'gender', type: 'smallint', nullable: false, options: ['default' => 1])]
protected ?int $gender;
#[ORM\Column(name: 'age', type: 'smallint', nullable: true)]
protected ?int $age;
#[ORM\Column(name: 'height', type: 'smallint', nullable: true)]
protected ?int $height;
#[ORM\Column(name: 'weight', type: 'smallint', nullable: true)]
protected ?int $weight;
#[ORM\Column(name: 'breast_size', type: 'smallint', nullable: true)]
protected ?int $breastSize;
#[ORM\Column(name: 'breast_type', type: 'smallint', nullable: true)]
protected ?int $breastType;
#[ORM\Column(name: 'cloth_size', type: 'smallint', nullable: true)]
protected ?int $clothSize;
#[ORM\Column(name: 'shoes_size', type: 'smallint', nullable: true)]
protected ?int $shoesSize;
#[ORM\Column(name: 'body_type', type: 'smallint', nullable: true)]
protected ?int $bodyType;
#[ORM\Column(name: 'hair_color', type: 'smallint', nullable: true)]
protected ?int $hairColor;
#[ORM\Column(name: 'private_haircut', type: 'smallint', nullable: true)]
protected ?int $privateHaircut;
#[ORM\Column(name: 'nationality', type: 'smallint', nullable: true)]
protected ?int $nationality;
#[ORM\Column(name: 'has_tattoo', type: 'boolean', nullable: true)]
protected ?bool $hasTattoo;
#[ORM\Column(name: 'has_piercing', type: 'boolean', nullable: true)]
protected ?bool $hasPiercing;
public function __construct(?int $gender, ?int $age, ?int $height, ?int $weight, ?int $breastSize, ?int $breastType, ?int $clothSize, ?int $shoesSize,
?int $bodyType, ?int $hairColor, ?int $privateHaircut, ?int $nationality, ?bool $hasTattoo, ?bool $hasPiercing)
{
$this->gender = $gender ?? Genders::FEMALE;
$this->age = $age;
$this->height = $height;
$this->weight = $weight;
$this->breastSize = $breastSize;
$this->breastType = $breastType;
$this->clothSize = $clothSize;
$this->shoesSize = $shoesSize;
$this->bodyType = $bodyType;
$this->hairColor = $hairColor;
$this->privateHaircut = $privateHaircut;
$this->nationality = $nationality;
$this->hasTattoo = $hasTattoo;
$this->hasPiercing = $hasPiercing;
if(null == $gender)
$gender = Genders::FEMALE;
if(false === array_search($gender, [Genders::FEMALE, Genders::MALE, Genders::TRANS]))
throw new \LogicException('Invalid gender type');
$this->gender = $gender;
}
public function getGender(): int
{
return $this->gender;
}
public function setGender(int $gender): void
{
$this->gender = $gender;
}
public function getAge(): ?int
{
return $this->age;
}
public function getHeight(): ?int
{
return $this->height;
}
public function getWeight(): ?int
{
return $this->weight;
}
public function getBreastSize(): ?int
{
return $this->breastSize;
}
public function getBreastType(): ?int
{
return $this->breastType;
}
public function getClothSize(): ?int
{
return $this->clothSize;
}
public function getShoesSize(): ?int
{
return $this->shoesSize;
}
public function getBodyType(): ?int
{
return $this->bodyType;
}
public function getHairColor(): ?int
{
return $this->hairColor;
}
public function getPrivateHaircut(): ?int
{
return $this->privateHaircut;
}
public function getNationality(): ?int
{
return $this->nationality;
}
public function hasTattoo(): ?bool
{
return $this->hasTattoo;
}
public function hasPiercing(): ?bool
{
return $this->hasPiercing;
}
}