<?php
namespace App\Object;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\Validator\Constraints as Assert;
class FestivalSearch
{
protected $location;
protected $date;
protected $locationhidden;
protected $placeid;
protected $distance;
public function __construct()
{
$this->distance=50000;
}
public function hydrate(array $array)
{
$this->location=$array['location'];
$this->date= $array['date'];
$this->locationhidden=$array['locationhidden'];
$this->placeid=$array['placeid'];
if(array_key_exists('distance', $array ))
$this->distance=$array['distance'];
}
public function getLocation(): ?string
{
return $this->location;
}
public function setLocation($location)
{
$this->location = $location;
}
public function getDate(): ?string
{
return $this->date;
}
public function setDate(string $date = null)
{
$this->date = $date;
}
public function getLocationhidden(): ?string
{
return $this->locationhidden;
}
public function setLocationhidden(string $locationhidden)
{
$this->locationhidden = $locationhidden;
}
public function getPlaceid(): ?string
{
return $this->placeid;
}
public function setPlaceid(string $placeid)
{
$this->placeid = $placeid;
}
public function getDistance():?int
{
return intval($this->distance);
}
public function setDistance(int $distance)
{
$this->distance = intval($distance);
}
public function CleanLocation()
{
if($this->getLocation()!= $this->getLocationhidden() || $this->getPlaceid()==null)
{
$this->locationhidden=null;
$this->placeid=null;
}
}
public function hasLocation()
{
return $this->location != null;
}
public function hasDate()
{
return $this->date !=null;
}
}
?>