src/Entity/ProfileTargetSetting.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\ProfileTargetSettingRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. #[ORM\Entity(repositoryClassProfileTargetSettingRepository::class)]
  9. #[ApiResource(
  10.     normalizationContext: ['groups' => ['profile']],
  11.     denormalizationContext: ['groups' => ['profile']],
  12.     
  13.     )]
  14. class ProfileTargetSetting
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     #[Groups("profile")]
  20.     private ?int $id null;
  21.     #[ORM\Column(nullabletrue)]
  22.     #[Groups("profile")]
  23.     private ?int $minAge 18;
  24.     #[ORM\Column(nullabletrue)]
  25.     #[Groups("profile")]
  26.     private ?int $maxAge 65;
  27.     #[ORM\Column(nullabletrue)]
  28.     #[Groups("profile")]
  29.     private ?int $rangePerKm 10000;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     #[Groups("profile")]
  32.     private ?string $lng null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     #[Groups("profile")]
  35.     private ?string $lat null;
  36.     #[ORM\Column(nullabletrue)]
  37.     #[Groups("profile")]
  38.     private ?bool $hasKids false;
  39.     #[ORM\Column(nullabletrue)]
  40.     #[Groups("profile")]
  41.     private ?bool $isDrinker false;
  42.     #[ORM\Column(nullabletrue)]
  43.     #[Groups("profile")]
  44.     private ?bool $isSmoker false;
  45.     #[ORM\OneToOne(mappedBy'profileTargetSetting')]
  46.     
  47.     private ?Profile $profile null;
  48.     #[ORM\Column(nullabletrue)]
  49.     #[Groups("profile")]
  50.     private ?bool $isDevorced false;
  51.     #[ORM\Column(type'json'nullabletrue)]
  52.     #[Groups("profile")]
  53.     private array $educationLevel = [];
  54.     
  55.     
  56.     
  57.     public function __toString(){
  58.         return (string)$this->minAge."<->".(string)$this->maxAge." - ".(string)$this->rangePerKm;
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getMinAge(): ?int
  65.     {
  66.         return $this->minAge;
  67.     }
  68.     public function setMinAge(?int $minAge): self
  69.     {
  70.         $this->minAge $minAge;
  71.         return $this;
  72.     }
  73.     public function getMaxAge(): ?int
  74.     {
  75.         return $this->maxAge;
  76.     }
  77.     public function setMaxAge(?int $maxAge): self
  78.     {
  79.         $this->maxAge $maxAge;
  80.         return $this;
  81.     }
  82.     public function getRangePerKm(): ?int
  83.     {
  84.         return $this->rangePerKm;
  85.     }
  86.     public function setRangePerKm(?int $rangePerKm): self
  87.     {
  88.         $this->rangePerKm $rangePerKm;
  89.         return $this;
  90.     }
  91.     public function getLng(): ?string
  92.     {
  93.         return $this->lng;
  94.     }
  95.     public function setLng(?string $lng): self
  96.     {
  97.         $this->lng $lng;
  98.         return $this;
  99.     }
  100.     public function getLat(): ?string
  101.     {
  102.         return $this->lat;
  103.     }
  104.     public function setLat(?string $lat): self
  105.     {
  106.         $this->lat $lat;
  107.         return $this;
  108.     }
  109.     public function getHasKids(): ?bool
  110.     {
  111.         return $this->hasKids;
  112.     }
  113.     public function setHasKids(?bool $hasKids): self
  114.     {
  115.         $this->hasKids $hasKids;
  116.         return $this;
  117.     }
  118.     public function getIsDrinker(): ?bool
  119.     {
  120.         return $this->isDrinker;
  121.     }
  122.     public function setIsDrinker(?bool $isDrinker): self
  123.     {
  124.         $this->isDrinker $isDrinker;
  125.         return $this;
  126.     }
  127.     public function getIsSmoker(): ?bool
  128.     {
  129.         return $this->isSmoker;
  130.     }
  131.     public function setIsSmoker(?bool $isSmoker): self
  132.     {
  133.         $this->isSmoker $isSmoker;
  134.         return $this;
  135.     }
  136.     public function getProfile(): ?Profile
  137.     {
  138.         return $this->profile;
  139.     }
  140.     public function setProfile(?Profile $profile): self
  141.     {
  142.         $this->profile $profile;
  143.         return $this;
  144.     }
  145.     public function getIsDevorced(): ?bool
  146.     {
  147.         return $this->isDevorced;
  148.     }
  149.     public function setIsDevorced(?bool $isDevorced): self
  150.     {
  151.         $this->isDevorced $isDevorced;
  152.         return $this;
  153.     }
  154.     public function getEducationLevel(): array
  155.     {
  156.         return $this->educationLevel;
  157.     }
  158.     public function setEducationLevel(?array $educationLevel): self
  159.     {
  160.         $this->educationLevel $educationLevel;
  161.         return $this;
  162.     }
  163. }