112 lines
2 KiB
PHP
112 lines
2 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="rider")
|
|
*/
|
|
class Rider
|
|
{
|
|
// unique id
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
// first name
|
|
/**
|
|
* @ORM\Column(type="string", length=50, nullable=true)
|
|
*/
|
|
protected $first_name;
|
|
|
|
// last name
|
|
/**
|
|
* @ORM\Column(type="string", length=50, nullable=true)
|
|
*/
|
|
protected $last_name;
|
|
|
|
// contact number
|
|
/**
|
|
* @ORM\Column(type="string", length=20, nullable=true)
|
|
*/
|
|
protected $contact_num;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Hub", inversedBy="riders")
|
|
* @ORM\JoinColumn(name="hub_id", referencedColumnName="id")
|
|
*/
|
|
protected $hub;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="rider")
|
|
*/
|
|
protected $job_orders;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->job_orders = new ArrayCollection();
|
|
}
|
|
|
|
public function getID()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function setFirstName($name)
|
|
{
|
|
$this->first_name = $name;
|
|
return $this;
|
|
}
|
|
|
|
public function getFirstName()
|
|
{
|
|
return $this->first_name;
|
|
}
|
|
|
|
public function setLastName($name)
|
|
{
|
|
$this->last_name = $name;
|
|
return $this;
|
|
}
|
|
|
|
public function getLastName()
|
|
{
|
|
return $this->last_name;
|
|
}
|
|
|
|
public function setContactNumber($num)
|
|
{
|
|
$this->contact_num = $num;
|
|
return $this;
|
|
}
|
|
|
|
public function getContactNumber()
|
|
{
|
|
return $this->contact_num;
|
|
}
|
|
|
|
public function setHub(Hub $hub)
|
|
{
|
|
$this->hub = $hub;
|
|
return $this;
|
|
}
|
|
|
|
public function getHub()
|
|
{
|
|
return $this->hub;
|
|
}
|
|
|
|
public function clearHub()
|
|
{
|
|
$this->hub = null;
|
|
return $this;
|
|
}
|
|
}
|