resq/src/Entity/SupportedArea.php
2023-12-20 18:15:17 +08:00

105 lines
1.9 KiB
PHP

<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use CrEOF\Spatial\PHP\Types\Geometry\Polygon;
use DateTime;
/**
* @ORM\Entity
* @ORM\Table(name="supported_area")
*/
class SupportedArea
{
// unique id
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
// date supported area was created
/**
* @ORM\Column(type="datetime")
*/
protected $date_create;
// name of the supported area
/**
* @ORM\Column(type="string", length=80)
*/
protected $name;
// coordinates of the supported area
/**
* @ORM\Column(type="polygon")
*/
protected $coverage_area;
/**
* @ORM\ManyToOne(targetEntity="PriceTier", inversedBy="supported_areas")
* @ORM\JoinColumn(name="price_tier_id", referencedColumnName="id", nullable=true)
*/
protected $price_tier;
public function __construct()
{
$this->date_create = new DateTime();
$this->price_tier = null;
}
public function getID()
{
return $this->id;
}
public function setDateCreate(DateTime $date_create)
{
$this->date_create = $date_create;
return $this;
}
public function getDateCreate()
{
return $this->date_Create;
}
public function setName($name)
{
$this->name = $name;
return $this;
}
public function getName()
{
return $this->name;
}
public function setCoverageArea(Polygon $polygon)
{
$this->coverage_area = $polygon;
return $this;
}
public function getCoverageArea()
{
return $this->coverage_area;
}
public function setPriceTier(PriceTier $price_tier)
{
$this->price_tier = $price_tier;
return $this;
}
public function getPriceTier()
{
return $this->price_tier;
}
}