295 lines
5.4 KiB
PHP
295 lines
5.4 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
use DateTime;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="warranty_raffle_log")
|
|
*/
|
|
class WarrantyRaffleLog
|
|
{
|
|
// unique id
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
// date created
|
|
/**
|
|
* @ORM\Column(type="datetime")
|
|
*/
|
|
protected $date_create;
|
|
|
|
// user that created warranty
|
|
/**
|
|
* @ORM\Column(type="string", length=32)
|
|
*/
|
|
protected $api_user;
|
|
|
|
// data sent
|
|
/**
|
|
* @ORM\Column(type="json")
|
|
*/
|
|
protected $data_sent;
|
|
|
|
// serial
|
|
/**
|
|
* @ORM\Column(type="string", length=20)
|
|
*/
|
|
protected $serial;
|
|
|
|
// warranty id
|
|
/**
|
|
* @ORM\Column(type="integer", nullable=true)
|
|
*/
|
|
protected $warranty_id;
|
|
|
|
// action done
|
|
/**
|
|
* @ORM\Column(type="string", length=50)
|
|
*/
|
|
protected $action;
|
|
|
|
// battery model name
|
|
/**
|
|
* @ORM\Column(type="string", length=80)
|
|
*/
|
|
protected $batt_model_name;
|
|
|
|
// battery size name
|
|
/**
|
|
* @ORM\Column(type="string", length=80)
|
|
*/
|
|
protected $batt_size_name;
|
|
|
|
// customer first name
|
|
/**
|
|
* @ORM\Column(type="string", length=80)
|
|
*/
|
|
protected $first_name;
|
|
|
|
// customer last name
|
|
/**
|
|
* @ORM\Column(type="string", length=80)
|
|
*/
|
|
protected $last_name;
|
|
|
|
// plate number
|
|
/**
|
|
* @ORM\Column(type="string", length=100)
|
|
*/
|
|
protected $plate_number;
|
|
|
|
// contact number
|
|
/**
|
|
* @ORM\Column(type="string", length=30)
|
|
*/
|
|
protected $contact_num;
|
|
|
|
// email
|
|
/**
|
|
* @ORM\Column(type="string", length=80)
|
|
*/
|
|
protected $email;
|
|
|
|
// customer address
|
|
/**
|
|
* @ORM\Column(type="string", length=280)
|
|
*/
|
|
protected $address;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->date_create = new DateTime();
|
|
$this->data_sent = [];
|
|
$this->serial = '';
|
|
$this->api_user = '';
|
|
$this->action = '';
|
|
$this->batt_model_name = '';
|
|
$this->batt_size_name = '';
|
|
$this->first_name = '';
|
|
$this->last_name = '';
|
|
$this->plate_number = '';
|
|
$this->contact_num = '';
|
|
$this->email = '';
|
|
$this->address = '';
|
|
}
|
|
|
|
public function getID()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function setDateCreate(DateTime $date_create)
|
|
{
|
|
$this->date_create = $date_create;
|
|
return $this;
|
|
}
|
|
|
|
public function getDateCreate()
|
|
{
|
|
return $this->date_create;
|
|
}
|
|
|
|
public function setApiUser($api_user)
|
|
{
|
|
$this->api_user = $api_user;
|
|
return $this;
|
|
}
|
|
|
|
public function getApiUser()
|
|
{
|
|
return $this->api_user;
|
|
}
|
|
|
|
public function addDataSent($id, $value)
|
|
{
|
|
$this->data_sent[$id] = $value;
|
|
return $this;
|
|
}
|
|
|
|
public function setDataSent($data_sent)
|
|
{
|
|
$this->data_sent = $data_sent;
|
|
return $this;
|
|
}
|
|
|
|
public function getDataSent($id)
|
|
{
|
|
// return null if we don't have it
|
|
if (!isset($this->data_sent[$id]))
|
|
return null;
|
|
|
|
return $this->data_sent[$id];
|
|
}
|
|
|
|
public function setSerial($serial)
|
|
{
|
|
$this->serial = $serial;
|
|
return $this;
|
|
}
|
|
|
|
public function getSerial()
|
|
{
|
|
return $this->serial;
|
|
}
|
|
|
|
public function setWarrantyID($warranty_id)
|
|
{
|
|
$this->warranty_id = $warranty_id;
|
|
return $this;
|
|
}
|
|
|
|
public function getWarrantyID()
|
|
{
|
|
return $this->warranty_id;
|
|
}
|
|
|
|
public function setAction($action)
|
|
{
|
|
$this->action = $action;
|
|
return $this;
|
|
}
|
|
|
|
public function getAction()
|
|
{
|
|
return $this->action;
|
|
}
|
|
|
|
public function setBattModelName($batt_model_name)
|
|
{
|
|
$this->batt_model_name = $batt_model_name;
|
|
return $this;
|
|
}
|
|
|
|
public function getBattModelName()
|
|
{
|
|
return $this->batt_model_name;
|
|
}
|
|
|
|
public function setBattSizeName($batt_size_name)
|
|
{
|
|
$this->batt_size_name = $batt_size_name;
|
|
return $this;
|
|
}
|
|
|
|
public function getBattSizeName()
|
|
{
|
|
return $this->batt_size_name;
|
|
}
|
|
|
|
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 setPlateNumber($plate_number)
|
|
{
|
|
$this->plate_number = $plate_number;
|
|
return $this;
|
|
}
|
|
|
|
public function getPlateNumber()
|
|
{
|
|
return $this->plate_number;
|
|
}
|
|
|
|
public function setContactNumber($contact_num)
|
|
{
|
|
$this->contact_num = $contact_num;
|
|
return $this;
|
|
}
|
|
|
|
public function getContactNumber()
|
|
{
|
|
return $this->contact_num;
|
|
}
|
|
|
|
public function setEmail($email)
|
|
{
|
|
$this->email = $email;
|
|
return $this;
|
|
}
|
|
|
|
public function getEmail()
|
|
{
|
|
return $this->email;
|
|
}
|
|
|
|
public function setAddress($address)
|
|
{
|
|
$this->cust_address = $address;
|
|
return $this;
|
|
}
|
|
|
|
public function getAddress()
|
|
{
|
|
return $this->cust_address;
|
|
}
|
|
}
|
|
|