64 lines
1.3 KiB
PHP
64 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="vehicle")
|
|
*/
|
|
class Vehicle
|
|
{
|
|
// unique id
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
// customer vehicles
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="CustomerVehicle", mappedBy="customer")
|
|
*/
|
|
protected $customers;
|
|
|
|
// manufacturer
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="VehicleManufacturer", inversedBy="vehicles")
|
|
* @ORM\JoinColumn(name="manufacturer_id", referencedColumnName="id")
|
|
*/
|
|
protected $manufacturer;
|
|
|
|
// make
|
|
/**
|
|
* @ORM\Column(type="string", length=80)
|
|
*/
|
|
protected $make;
|
|
|
|
// model year from
|
|
/**
|
|
* @ORM\Column(type="smallint")
|
|
*/
|
|
protected $model_year_from;
|
|
|
|
// model year to
|
|
/**
|
|
* @ORM\Column(type="smallint")
|
|
*/
|
|
protected $model_year_to;
|
|
|
|
// link to batteries compatible with this vehicle
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Battery", mappedBy="vehicle")
|
|
*/
|
|
protected $batteries;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->customers = new ArrayCollection();
|
|
$this->batteries = new ArrayCollection();
|
|
}
|
|
}
|