src/CoreBundle/Entity/ConfiguratorOffer.php line 17

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use DcSiteBundle\Entity\Accessories;
  5. use CoreBundle\Entity\Vehicles\VehicleItem;
  6. use CoreBundle\Entity\Vehicles\ConfiguratorColor;
  7. use CoreBundle\Entity\Vehicles\ConfiguratorInterier;
  8. use CoreBundle\Entity\Vehicles\EquipmentOptions;
  9. use DateTime;
  10. use Doctrine\Common\Collections\Collection;
  11. /**
  12.  * ConfiguratorOffer
  13.  */
  14. class ConfiguratorOffer
  15. {
  16.     /**
  17.      * @var integer
  18.      */
  19.     private $id;
  20.     /**
  21.      * @var DateTime
  22.      */
  23.     private $date_create;
  24.     /**
  25.      * @var string
  26.      */
  27.     private $insurance;
  28.     /**
  29.      * @var string
  30.      */
  31.     private $credit;
  32.     /**
  33.      * @var integer
  34.      */
  35.     private $total_price;
  36.     /**
  37.      * @var integer
  38.      */
  39.     private $offer_price;
  40.     /**
  41.      * @var Collection
  42.      */
  43.     private $accessories;
  44.     /**
  45.      * @var Collection
  46.      */
  47.     private $options;
  48.     /**
  49.      * Constructor
  50.      */
  51.     public function __construct()
  52.     {
  53.         $this->accessories = new ArrayCollection();
  54.         $this->options = new ArrayCollection();
  55.     }
  56.     /**
  57.      * Get id
  58.      *
  59.      * @return integer
  60.      */
  61.     public function getId()
  62.     {
  63.         return $this->id;
  64.     }
  65.     /**
  66.      * Set dateCreate
  67.      *
  68.      * @param DateTime $dateCreate
  69.      *
  70.      * @return ConfiguratorOffer
  71.      */
  72.     public function setDateCreate($dateCreate)
  73.     {
  74.         $this->date_create $dateCreate;
  75.         return $this;
  76.     }
  77.     /**
  78.      * Get dateCreate
  79.      *
  80.      * @return DateTime
  81.      */
  82.     public function getDateCreate()
  83.     {
  84.         return $this->date_create;
  85.     }
  86.     /**
  87.      * Set insurance
  88.      *
  89.      * @param string $insurance
  90.      *
  91.      * @return ConfiguratorOffer
  92.      */
  93.     public function setInsurance($insurance)
  94.     {
  95.         $this->insurance $insurance;
  96.         return $this;
  97.     }
  98.     /**
  99.      * Get insurance
  100.      *
  101.      * @return string
  102.      */
  103.     public function getInsurance()
  104.     {
  105.         return $this->insurance;
  106.     }
  107.     public function getInsuranceArray()
  108.     {
  109.         return json_decode($this->insurancetrue);
  110.     }
  111.     /**
  112.      * Set credit
  113.      *
  114.      * @param string $credit
  115.      *
  116.      * @return ConfiguratorOffer
  117.      */
  118.     public function setCredit($credit)
  119.     {
  120.         $this->credit $credit;
  121.         return $this;
  122.     }
  123.     /**
  124.      * Get credit
  125.      *
  126.      * @return string
  127.      */
  128.     public function getCredit()
  129.     {
  130.         return $this->credit;
  131.     }
  132.     public function getCreditArray()
  133.     {
  134.         return json_decode($this->credittrue);
  135.     }
  136.     /**
  137.      * Set totalPrice
  138.      *
  139.      * @param integer $totalPrice
  140.      *
  141.      * @return ConfiguratorOffer
  142.      */
  143.     public function setTotalPrice($totalPrice)
  144.     {
  145.         $this->total_price $totalPrice;
  146.         return $this;
  147.     }
  148.     /**
  149.      * Get totalPrice
  150.      *
  151.      * @return integer
  152.      */
  153.     public function getTotalPrice()
  154.     {
  155.         return $this->total_price;
  156.     }
  157.     /**
  158.      * Set offerPrice
  159.      *
  160.      * @param integer $offerPrice
  161.      *
  162.      * @return ConfiguratorOffer
  163.      */
  164.     public function setOfferPrice($offerPrice)
  165.     {
  166.         $this->offer_price $offerPrice;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get offerPrice
  171.      *
  172.      * @return integer
  173.      */
  174.     public function getOfferPrice()
  175.     {
  176.         return $this->offer_price;
  177.     }
  178.     /**
  179.      * Add accessory
  180.      *
  181.      * @param Accessories $accessory
  182.      *
  183.      * @return ConfiguratorOffer
  184.      */
  185.     public function addAccessory(Accessories $accessory)
  186.     {
  187.         $this->accessories[] = $accessory;
  188.         return $this;
  189.     }
  190.     /**
  191.      * Remove accessory
  192.      *
  193.      * @param Accessories $accessory
  194.      */
  195.     public function removeAccessory(Accessories $accessory)
  196.     {
  197.         $this->accessories->removeElement($accessory);
  198.     }
  199.     /**
  200.      * Get accessories
  201.      *
  202.      * @return Collection
  203.      */
  204.     public function getAccessories()
  205.     {
  206.         return $this->accessories;
  207.     }
  208.     
  209.     /**
  210.      * @var integer
  211.      */
  212.     private $is_send;
  213.     /**
  214.      * Set isSend
  215.      *
  216.      * @param integer $isSend
  217.      *
  218.      * @return ConfiguratorOffer
  219.      */
  220.     public function setIsSend($isSend)
  221.     {
  222.         $this->is_send $isSend;
  223.         return $this;
  224.     }
  225.     /**
  226.      * Get isSend
  227.      *
  228.      * @return integer
  229.      */
  230.     public function getIsSend()
  231.     {
  232.         return $this->is_send;
  233.     }
  234.     /**
  235.      * @var Dealer
  236.      */
  237.     private $dealer;
  238.     /**
  239.      * Set dealer
  240.      *
  241.      * @param Dealer $dealer
  242.      *
  243.      * @return ConfiguratorOffer
  244.      */
  245.     public function setDealer(Dealer $dealer null)
  246.     {
  247.         $this->dealer $dealer;
  248.         return $this;
  249.     }
  250.     /**
  251.      * Get dealer
  252.      *
  253.      * @return Dealer
  254.      */
  255.     public function getDealer()
  256.     {
  257.         return $this->dealer;
  258.     }
  259.     /**
  260.      * @var string
  261.      */
  262.     private $name;
  263.     /**
  264.      * @var string
  265.      */
  266.     private $email;
  267.     /**
  268.      * @var string
  269.      */
  270.     private $phone;
  271.     /**
  272.      * Set name
  273.      *
  274.      * @param string $name
  275.      *
  276.      * @return ConfiguratorOffer
  277.      */
  278.     public function setName($name)
  279.     {
  280.         $this->name $name;
  281.         return $this;
  282.     }
  283.     /**
  284.      * Get name
  285.      *
  286.      * @return string
  287.      */
  288.     public function getName()
  289.     {
  290.         return $this->name;
  291.     }
  292.     /**
  293.      * Set email
  294.      *
  295.      * @param string $email
  296.      *
  297.      * @return ConfiguratorOffer
  298.      */
  299.     public function setEmail($email)
  300.     {
  301.         $this->email $email;
  302.         return $this;
  303.     }
  304.     /**
  305.      * Get email
  306.      *
  307.      * @return string
  308.      */
  309.     public function getEmail()
  310.     {
  311.         return $this->email;
  312.     }
  313.     /**
  314.      * Set phone
  315.      *
  316.      * @param string $phone
  317.      *
  318.      * @return ConfiguratorOffer
  319.      */
  320.     public function setPhone($phone)
  321.     {
  322.         $this->phone $phone;
  323.         return $this;
  324.     }
  325.     /**
  326.      * Get phone
  327.      *
  328.      * @return string
  329.      */
  330.     public function getPhone()
  331.     {
  332.         return $this->phone;
  333.     }
  334.     public function __toString()
  335.     {
  336.         if ($this->getVehicleItem()) {
  337.             return $this->getVehicleItem()->getVehicle()->getModel()->getTitle() . ' / ' $this->getVehicleItem()->getEquipment()->getTitle();
  338.         }
  339.         return '';
  340.     }
  341.     /**
  342.      * @var integer
  343.      */
  344.     private $is_finish;
  345.     /**
  346.      * Set isFinish
  347.      *
  348.      * @param integer $isFinish
  349.      *
  350.      * @return ConfiguratorOffer
  351.      */
  352.     public function setIsFinish($isFinish)
  353.     {
  354.         $this->is_finish $isFinish;
  355.         return $this;
  356.     }
  357.     /**
  358.      * Get isFinish
  359.      *
  360.      * @return integer
  361.      */
  362.     public function getIsFinish()
  363.     {
  364.         return $this->is_finish;
  365.     }
  366.     /**
  367.      * @var string
  368.      */
  369.     private $hash;
  370.     /**
  371.      * Set hash
  372.      *
  373.      * @param string $hash
  374.      *
  375.      * @return ConfiguratorOffer
  376.      */
  377.     public function setHash($hash)
  378.     {
  379.         $this->hash $hash;
  380.         return $this;
  381.     }
  382.     /**
  383.      * Get hash
  384.      *
  385.      * @return string
  386.      */
  387.     public function getHash()
  388.     {
  389.         return $this->hash;
  390.     }
  391.     /**
  392.      * @var integer
  393.      */
  394.     private $notify_send;
  395.     /**
  396.      * Set notifySend
  397.      *
  398.      * @param integer $notifySend
  399.      *
  400.      * @return ConfiguratorOffer
  401.      */
  402.     public function setNotifySend($notifySend)
  403.     {
  404.         $this->notify_send $notifySend;
  405.         return $this;
  406.     }
  407.     /**
  408.      * Get notifySend
  409.      *
  410.      * @return integer
  411.      */
  412.     public function getNotifySend()
  413.     {
  414.         return $this->notify_send;
  415.     }
  416.     /**
  417.      * @var VehicleItem
  418.      */
  419.     private $vehicle_item;
  420.     /**
  421.      * Set vehicleItem
  422.      *
  423.      * @param VehicleItem $vehicleItem
  424.      *
  425.      * @return ConfiguratorOffer
  426.      */
  427.     public function setVehicleItem(VehicleItem $vehicleItem null)
  428.     {
  429.         $this->vehicle_item $vehicleItem;
  430.         return $this;
  431.     }
  432.     /**
  433.      * Get vehicleItem
  434.      *
  435.      * @return VehicleItem
  436.      */
  437.     public function getVehicleItem()
  438.     {
  439.         return $this->vehicle_item;
  440.     }
  441.     /**
  442.      * @var ConfiguratorColor
  443.      */
  444.     private $color;
  445.     /**
  446.      * @var ConfiguratorInterier
  447.      */
  448.     private $interier;
  449.     /**
  450.      * Set color
  451.      *
  452.      * @param ConfiguratorColor $color
  453.      *
  454.      * @return ConfiguratorOffer
  455.      */
  456.     public function setColor(ConfiguratorColor $color null)
  457.     {
  458.         $this->color $color;
  459.         return $this;
  460.     }
  461.     /**
  462.      * Get color
  463.      *
  464.      * @return ConfiguratorColor
  465.      */
  466.     public function getColor()
  467.     {
  468.         return $this->color;
  469.     }
  470.     /**
  471.      * Set interier
  472.      *
  473.      * @param ConfiguratorInterier $interier
  474.      *
  475.      * @return ConfiguratorOffer
  476.      */
  477.     public function setInterier(ConfiguratorInterier $interier null)
  478.     {
  479.         $this->interier $interier;
  480.         return $this;
  481.     }
  482.     /**
  483.      * Get interier
  484.      *
  485.      * @return ConfiguratorInterier
  486.      */
  487.     public function getInterier()
  488.     {
  489.         return $this->interier;
  490.     }
  491.     /**
  492.      * @var User
  493.      */
  494.     private $user;
  495.     /**
  496.      * Set user
  497.      *
  498.      * @param User $user
  499.      *
  500.      * @return ConfiguratorOffer
  501.      */
  502.     public function setUser(User $user null)
  503.     {
  504.         $this->user $user;
  505.         return $this;
  506.     }
  507.     /**
  508.      * Get user
  509.      *
  510.      * @return User
  511.      */
  512.     public function getUser()
  513.     {
  514.         return $this->user;
  515.     }
  516.     /**
  517.      * Add option
  518.      *
  519.      * @param EquipmentOptions $option
  520.      *
  521.      * @return ConfiguratorOffer
  522.      */
  523.     public function addOption(EquipmentOptions $option)
  524.     {
  525.         $this->options[] = $option;
  526.         return $this;
  527.     }
  528.     /**
  529.      * Remove option
  530.      *
  531.      * @param EquipmentOptions $option
  532.      */
  533.     public function removeOption(EquipmentOptions $option)
  534.     {
  535.         $this->options->removeElement($option);
  536.     }
  537.     /**
  538.      * Get options
  539.      *
  540.      * @return Collection
  541.      */
  542.     public function getOptions()
  543.     {
  544.         return $this->options;
  545.     }
  546. }