resq/src/Entity/Outlet.php

60 lines
1.1 KiB
PHP

<?php
namespace App\Entity;
use App\Ramcar\Location;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use DateTime;
/**
* @ORM\Entity
* @ORM\Table(name="outlet")
*/
class Outlet
{
use Location;
// job orders assigned to outlet
/**
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="outlet")
*/
protected $job_orders;
/**
* @ORM\ManyToOne(targetEntity="Hub", inversedBy="outlets")
* @ORM\JoinColumn(name="hub_id", referencedColumnName="id")
*/
protected $hub;
public function __construct()
{
$this->time_open = new DateTime();
$this->time_close = new DateTime();
$this->job_orders = new ArrayCollection();
}
public function getJobOrders()
{
return $this->job_orders;
}
public function setHub(Hub $hub)
{
$this->hub = $hub;
return $this;
}
public function getHub()
{
return $this->hub;
}
public function clearHub()
{
$this->hub = null;
return $this;
}
}