151 lines
2.7 KiB
PHP
151 lines
2.7 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;
|
|
|
|
// plate number
|
|
/**
|
|
* @ORM\Column(type="string", length=10)
|
|
* @Assert\NotBlank()
|
|
*/
|
|
protected $plate_number;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Hub", inversedBy="riders")
|
|
* @ORM\JoinColumn(name="hub_id", referencedColumnName="id")
|
|
*/
|
|
protected $hub;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="rider")
|
|
*/
|
|
protected $job_orders;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
protected $image_file;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->job_orders = new ArrayCollection();
|
|
}
|
|
|
|
public function getID()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function setFirstName($first_name)
|
|
{
|
|
$this->first_name = $first_name;
|
|
return $this;
|
|
}
|
|
|
|
public function getFirstName()
|
|
{
|
|
return $this->first_name;
|
|
}
|
|
|
|
public function setLastName($last_name)
|
|
{
|
|
$this->last_name = $last_name;
|
|
return $this;
|
|
}
|
|
|
|
public function getLastName()
|
|
{
|
|
return $this->last_name;
|
|
}
|
|
|
|
public function getFullName()
|
|
{
|
|
return $this->first_name . ' ' . $this->last_name;
|
|
}
|
|
|
|
public function setPlateNumber($plate_number)
|
|
{
|
|
$this->plate_number = $plate_number;
|
|
return $this;
|
|
}
|
|
|
|
public function getPlateNumber()
|
|
{
|
|
return $this->plate_number;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
public function setImageFile($image_file)
|
|
{
|
|
$this->image_file = $image_file;
|
|
return $this;
|
|
}
|
|
|
|
public function getImageFile()
|
|
{
|
|
return $this->image_file;
|
|
}
|
|
}
|