resq/src/Entity/Hub.php

49 lines
937 B
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="hub")
*/
class Hub
{
use Location;
// riders assigned to this hub
/**
* @ORM\OneToMany(targetEntity="Rider", mappedBy="hub")
*/
protected $riders;
// outlets under this hub
/**
* @ORM\OneToMany(targetEntity="Outlet", mappedBy="hub")
*/
protected $outlets;
public function __construct()
{
$this->time_open = new DateTime();
$this->time_close = new DateTime();
$this->riders = new ArrayCollection();
$this->outlets = new ArrayCollection();
}
public function getRiders()
{
return $this->riders;
}
public function getOutlets()
{
return $this->outlets;
}
}