<?php
/**
* Created by PhpStorm.
* User: parcel
* Date: 9/28/18
* Time: 7:51 AM
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
/**
* @ORM\Entity
* @ORM\Table(name="model")
*/
class Model {
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=15)
*/
private $modelName;
/**
* @var \App\Entity\Manufacturer
* @Serializer\Type("App\Entity\Manufacturer")
* @ORM\ManyToOne(targetEntity="App\Entity\Manufacturer")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="manufacturer_id", referencedColumnName="id")
* })
*/
private $manufacturer;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getModelName()
{
return $this->modelName;
}
/**
* @param mixed $modelName
*/
public function setModelName($modelName)
{
$this->modelName = $modelName;
}
/**
* @return Manufacturer
*/
public function getManufacturer()
{
return $this->manufacturer;
}
/**
* @param Manufacturer $manufacturer
*/
public function setManufacturer($manufacturer)
{
$this->manufacturer = $manufacturer;
}
public function __toString()
{
// TODO: Implement __toString() method.
return $this->manufacturer->getManufacturerName().' '.$this->modelName;
}
}