96 lines
2 KiB
PHP
96 lines
2 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="customer_vehicle")
|
|
*/
|
|
class CustomerVehicle
|
|
{
|
|
// unique id
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
// user-defined name for vehicle
|
|
/**
|
|
* @ORM\Column(type="string", length=80)
|
|
*/
|
|
protected $name;
|
|
|
|
// link to customer
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Customer", inversedBy="vehicles")
|
|
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id")
|
|
*/
|
|
protected $customer;
|
|
|
|
// vehicle
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Vehicle", inversedBy="customers")
|
|
* @ORM\JoinColumn(name="vehicle_id", referencedColumnName="id")
|
|
*/
|
|
protected $vehicle;
|
|
|
|
// plate number
|
|
/**
|
|
* @ORM\Column(type="string", length=10)
|
|
*/
|
|
protected $plate_number;
|
|
|
|
// model year
|
|
/**
|
|
* @ORM\Column(type="smallint")
|
|
*/
|
|
protected $model_year;
|
|
|
|
// vehicle status (new / second-hand)
|
|
/**
|
|
* @ORM\Column(type="string", length=15)
|
|
*/
|
|
protected $status_condition;
|
|
|
|
// fuel type - diesel, gas
|
|
/**
|
|
* @ORM\Column(type="string", length=15)
|
|
*/
|
|
protected $fuel_type;
|
|
|
|
// warranty code
|
|
// TODO: figure out how to check expiration
|
|
/**
|
|
* @ORM\Column(type="string", length=20)
|
|
*/
|
|
protected $warranty_code;
|
|
|
|
// date that battery warranty expires
|
|
/**
|
|
* @ORM\Column(type="date")
|
|
*/
|
|
protected $warranty_expiration;
|
|
|
|
// link to current battery
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Battery", inversedBy="cust_vehicles")
|
|
* @ORM\JoinColumn(name="battery_id", referencedColumnName="id")
|
|
*/
|
|
protected $curr_battery;
|
|
|
|
// vehicle using motolite battery?
|
|
/**
|
|
* @ORM\Column(type="boolean")
|
|
*/
|
|
protected $flag_motolite_battery;
|
|
|
|
// is vehicle still active?
|
|
/**
|
|
* @ORM\Column(type="boolean")
|
|
*/
|
|
protected $flag_active;
|
|
}
|