Add new entity for customer vehicle warranty code history #525

This commit is contained in:
Kendrick Chan 2020-10-26 16:30:14 +08:00
parent 668f49f335
commit 7898595bff

View file

@ -0,0 +1,94 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use DateTime;
/**
* @ORM\Entity
* @ORM\Table(name="cv_warranty_history")
*/
class CVWarrantyHistory
{
// unique id
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
// customer vehicle id, loose coupling
/**
* @ORM\Column(type="integer")
*/
protected $cv_id;
/**
* @ORM\Column(type="datetime")
*/
protected $date_create;
// warranty code
/**
* @ORM\Column(type="string", length=20)
*/
protected $warranty_code;
/**
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
protected $user;
public function __construct()
{
$this->date_create = new DateTime();
}
public function getID()
{
return $this->id;
}
public function getDateCreate()
{
return $this->date_create;
}
public function setWarrantyCode($warranty_code)
{
$this->warranty_code = $warranty_code;
return $this;
}
public function getWarrantyCode()
{
return $this->warranty_code;
}
public function setCVID($cv_id)
{
$this->cv_id = $cv_id;
return $this;
}
public function getCVID()
{
return $this->cv_id;
}
public function setUser($user)
{
$this->user;
return $this;
}
public function getUser()
{
return $this->user;
}
}