<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\ProfileTargetSettingRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: ProfileTargetSettingRepository::class)]
#[ApiResource(
normalizationContext: ['groups' => ['profile']],
denormalizationContext: ['groups' => ['profile']],
)]
class ProfileTargetSetting
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups("profile")]
private ?int $id = null;
#[ORM\Column(nullable: true)]
#[Groups("profile")]
private ?int $minAge = 18;
#[ORM\Column(nullable: true)]
#[Groups("profile")]
private ?int $maxAge = 65;
#[ORM\Column(nullable: true)]
#[Groups("profile")]
private ?int $rangePerKm = 10000;
#[ORM\Column(length: 255, nullable: true)]
#[Groups("profile")]
private ?string $lng = null;
#[ORM\Column(length: 255, nullable: true)]
#[Groups("profile")]
private ?string $lat = null;
#[ORM\Column(nullable: true)]
#[Groups("profile")]
private ?bool $hasKids = false;
#[ORM\Column(nullable: true)]
#[Groups("profile")]
private ?bool $isDrinker = false;
#[ORM\Column(nullable: true)]
#[Groups("profile")]
private ?bool $isSmoker = false;
#[ORM\OneToOne(mappedBy: 'profileTargetSetting')]
private ?Profile $profile = null;
#[ORM\Column(nullable: true)]
#[Groups("profile")]
private ?bool $isDevorced = false;
#[ORM\Column(type: 'json', nullable: true)]
#[Groups("profile")]
private array $educationLevel = [];
public function __toString(){
return (string)$this->minAge."<->".(string)$this->maxAge." - ".(string)$this->rangePerKm;
}
public function getId(): ?int
{
return $this->id;
}
public function getMinAge(): ?int
{
return $this->minAge;
}
public function setMinAge(?int $minAge): self
{
$this->minAge = $minAge;
return $this;
}
public function getMaxAge(): ?int
{
return $this->maxAge;
}
public function setMaxAge(?int $maxAge): self
{
$this->maxAge = $maxAge;
return $this;
}
public function getRangePerKm(): ?int
{
return $this->rangePerKm;
}
public function setRangePerKm(?int $rangePerKm): self
{
$this->rangePerKm = $rangePerKm;
return $this;
}
public function getLng(): ?string
{
return $this->lng;
}
public function setLng(?string $lng): self
{
$this->lng = $lng;
return $this;
}
public function getLat(): ?string
{
return $this->lat;
}
public function setLat(?string $lat): self
{
$this->lat = $lat;
return $this;
}
public function getHasKids(): ?bool
{
return $this->hasKids;
}
public function setHasKids(?bool $hasKids): self
{
$this->hasKids = $hasKids;
return $this;
}
public function getIsDrinker(): ?bool
{
return $this->isDrinker;
}
public function setIsDrinker(?bool $isDrinker): self
{
$this->isDrinker = $isDrinker;
return $this;
}
public function getIsSmoker(): ?bool
{
return $this->isSmoker;
}
public function setIsSmoker(?bool $isSmoker): self
{
$this->isSmoker = $isSmoker;
return $this;
}
public function getProfile(): ?Profile
{
return $this->profile;
}
public function setProfile(?Profile $profile): self
{
$this->profile = $profile;
return $this;
}
public function getIsDevorced(): ?bool
{
return $this->isDevorced;
}
public function setIsDevorced(?bool $isDevorced): self
{
$this->isDevorced = $isDevorced;
return $this;
}
public function getEducationLevel(): array
{
return $this->educationLevel;
}
public function setEducationLevel(?array $educationLevel): self
{
$this->educationLevel = $educationLevel;
return $this;
}
}