<?php
namespace CoreBundle\Entity;use Doctrine\Common\Collections\ArrayCollection;use DcSiteBundle\Entity\Accessories;use CoreBundle\Entity\Vehicles\VehicleItem;use CoreBundle\Entity\Vehicles\ConfiguratorColor;use CoreBundle\Entity\Vehicles\ConfiguratorInterier;use CoreBundle\Entity\Vehicles\EquipmentOptions;use DateTime;use Doctrine\Common\Collections\Collection;/** * ConfiguratorOffer */class ConfiguratorOffer
{
/**
* @var integer
*/
private $id;
/** * @var DateTime */ private $date_create;
/**
* @var string
*/
private $insurance;
/**
* @var string
*/
private $credit;
/**
* @var integer
*/
private $total_price;
/**
* @var integer
*/
private $offer_price;
/** * @var Collection */ private $accessories;
/** * @var Collection */ private $options;
/**
* Constructor
*/
public function __construct()
{
$this->accessories = new ArrayCollection();
$this->options = new ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/** * Set dateCreate * * @param DateTime $dateCreate * * @return ConfiguratorOffer */ public function setDateCreate($dateCreate)
{
$this->date_create = $dateCreate;
return $this;
}
/** * Get dateCreate * * @return DateTime */ public function getDateCreate()
{
return $this->date_create;
}
/**
* Set insurance
*
* @param string $insurance
*
* @return ConfiguratorOffer
*/
public function setInsurance($insurance)
{
$this->insurance = $insurance;
return $this;
}
/**
* Get insurance
*
* @return string
*/
public function getInsurance()
{
return $this->insurance;
}
public function getInsuranceArray()
{
return json_decode($this->insurance, true);
}
/**
* Set credit
*
* @param string $credit
*
* @return ConfiguratorOffer
*/
public function setCredit($credit)
{
$this->credit = $credit;
return $this;
}
/**
* Get credit
*
* @return string
*/
public function getCredit()
{
return $this->credit;
}
public function getCreditArray()
{
return json_decode($this->credit, true);
}
/**
* Set totalPrice
*
* @param integer $totalPrice
*
* @return ConfiguratorOffer
*/
public function setTotalPrice($totalPrice)
{
$this->total_price = $totalPrice;
return $this;
}
/**
* Get totalPrice
*
* @return integer
*/
public function getTotalPrice()
{
return $this->total_price;
}
/**
* Set offerPrice
*
* @param integer $offerPrice
*
* @return ConfiguratorOffer
*/
public function setOfferPrice($offerPrice)
{
$this->offer_price = $offerPrice;
return $this;
}
/**
* Get offerPrice
*
* @return integer
*/
public function getOfferPrice()
{
return $this->offer_price;
}
/** * Add accessory * * @param Accessories $accessory * * @return ConfiguratorOffer */ public function addAccessory(Accessories $accessory)
{
$this->accessories[] = $accessory;
return $this;
}
/** * Remove accessory * * @param Accessories $accessory */ public function removeAccessory(Accessories $accessory)
{
$this->accessories->removeElement($accessory);
}
/** * Get accessories * * @return Collection */ public function getAccessories()
{
return $this->accessories;
}
/**
* @var integer
*/
private $is_send;
/**
* Set isSend
*
* @param integer $isSend
*
* @return ConfiguratorOffer
*/
public function setIsSend($isSend)
{
$this->is_send = $isSend;
return $this;
}
/**
* Get isSend
*
* @return integer
*/
public function getIsSend()
{
return $this->is_send;
}
/** * @var Dealer */ private $dealer;
/** * Set dealer * * @param Dealer $dealer * * @return ConfiguratorOffer */ public function setDealer(Dealer $dealer = null)
{
$this->dealer = $dealer;
return $this;
}
/** * Get dealer * * @return Dealer */ public function getDealer()
{
return $this->dealer;
}
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $email;
/**
* @var string
*/
private $phone;
/**
* Set name
*
* @param string $name
*
* @return ConfiguratorOffer
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set email
*
* @param string $email
*
* @return ConfiguratorOffer
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get email
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set phone
*
* @param string $phone
*
* @return ConfiguratorOffer
*/
public function setPhone($phone)
{
$this->phone = $phone;
return $this;
}
/**
* Get phone
*
* @return string
*/
public function getPhone()
{
return $this->phone;
}
public function __toString()
{
if ($this->getVehicleItem()) {
return $this->getVehicleItem()->getVehicle()->getModel()->getTitle() . ' / ' . $this->getVehicleItem()->getEquipment()->getTitle();
}
return '';
}
/**
* @var integer
*/
private $is_finish;
/**
* Set isFinish
*
* @param integer $isFinish
*
* @return ConfiguratorOffer
*/
public function setIsFinish($isFinish)
{
$this->is_finish = $isFinish;
return $this;
}
/**
* Get isFinish
*
* @return integer
*/
public function getIsFinish()
{
return $this->is_finish;
}
/**
* @var string
*/
private $hash;
/**
* Set hash
*
* @param string $hash
*
* @return ConfiguratorOffer
*/
public function setHash($hash)
{
$this->hash = $hash;
return $this;
}
/**
* Get hash
*
* @return string
*/
public function getHash()
{
return $this->hash;
}
/**
* @var integer
*/
private $notify_send;
/**
* Set notifySend
*
* @param integer $notifySend
*
* @return ConfiguratorOffer
*/
public function setNotifySend($notifySend)
{
$this->notify_send = $notifySend;
return $this;
}
/**
* Get notifySend
*
* @return integer
*/
public function getNotifySend()
{
return $this->notify_send;
}
/** * @var VehicleItem */ private $vehicle_item;
/** * Set vehicleItem * * @param VehicleItem $vehicleItem * * @return ConfiguratorOffer */ public function setVehicleItem(VehicleItem $vehicleItem = null)
{
$this->vehicle_item = $vehicleItem;
return $this;
}
/** * Get vehicleItem * * @return VehicleItem */ public function getVehicleItem()
{
return $this->vehicle_item;
}
/** * @var ConfiguratorColor */ private $color;
/** * @var ConfiguratorInterier */ private $interier;
/** * Set color * * @param ConfiguratorColor $color * * @return ConfiguratorOffer */ public function setColor(ConfiguratorColor $color = null)
{
$this->color = $color;
return $this;
}
/** * Get color * * @return ConfiguratorColor */ public function getColor()
{
return $this->color;
}
/** * Set interier * * @param ConfiguratorInterier $interier * * @return ConfiguratorOffer */ public function setInterier(ConfiguratorInterier $interier = null)
{
$this->interier = $interier;
return $this;
}
/** * Get interier * * @return ConfiguratorInterier */ public function getInterier()
{
return $this->interier;
}
/** * @var User */ private $user;
/** * Set user * * @param User $user * * @return ConfiguratorOffer */ public function setUser(User $user = null)
{
$this->user = $user;
return $this;
}
/** * Get user * * @return User */ public function getUser()
{
return $this->user;
}
/** * Add option * * @param EquipmentOptions $option * * @return ConfiguratorOffer */ public function addOption(EquipmentOptions $option)
{
$this->options[] = $option;
return $this;
}
/** * Remove option * * @param EquipmentOptions $option */ public function removeOption(EquipmentOptions $option)
{
$this->options->removeElement($option);
}
/** * Get options * * @return Collection */ public function getOptions()
{
return $this->options;
}
}