src/CoreBundle/Entity/Vehicles/VehicleItem.php line 15

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity\Vehicles;
  3. use DateTime;
  4. use Application\Sonata\MediaBundle\Entity\Media;
  5. use CoreBundle\Entity\ConfiguratorOffer;
  6. use CoreBundle\Entity\User;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. /**
  10.  * VehicleItem
  11.  */
  12. class
  13. VehicleItem
  14. {
  15.     /**
  16.      * @var integer
  17.      */
  18.     private $id;
  19.     /**
  20.      * @var float
  21.      */
  22.     private $price;
  23.     /**
  24.      * @var integer
  25.      */
  26.     private $alt_price;
  27.     /**
  28.      * @var float
  29.      */
  30.     private $alt_rate;
  31.     /**
  32.      * @var integer
  33.      */
  34.     private $preorder_price;
  35.     /**
  36.      * @var integer
  37.      */
  38.     private $rent_price;
  39.     /**
  40.      * @var integer
  41.      */
  42.     private $year;
  43.     /**
  44.      * @var integer
  45.      */
  46.     private $mileage 0;
  47.     /**
  48.      * @var integer
  49.      */
  50.     private $state 0;
  51.     /**
  52.      * @var User
  53.      */
  54.     private $creator;
  55.     /**
  56.      * @var Equipment
  57.      */
  58.     private $equipment;
  59.     /**
  60.      * @var Variation
  61.      */
  62.     private $variation;
  63.     /**
  64.      * @var Vehicle
  65.      */
  66.     private $vehicle;
  67.     /**
  68.      * @var integer
  69.      */
  70.     private $single_owner 0;
  71.     /**
  72.      * @var integer
  73.      */
  74.     private $service_book 0;
  75.     /**
  76.      * @var integer
  77.      */
  78.     private $buy_in_ukraine 0;
  79.     /**
  80.      * @var integer
  81.      */
  82.     private $no_accident 0;
  83.     /**
  84.      * @var integer
  85.      */
  86.     private $credit_min_amount 0;
  87.     /**
  88.      * @var integer
  89.      */
  90.     private $credit_percent 0;
  91.     /**
  92.      * @var integer
  93.      */
  94.     private $has_nds 0;
  95.     /**
  96.      * @var integer
  97.      */
  98.     private $sold 0;
  99.     /**
  100.      * @var integer
  101.      */
  102.     private $deposit 0;
  103.     /**
  104.      * @var boolean
  105.      */
  106.     private $specify_price 0;
  107.     /**
  108.      * @var Collection
  109.      */
  110.     private $offer;
  111.     /**
  112.      * @var string
  113.      */
  114.     private $programm;
  115.     /**
  116.      * @var Specification
  117.      */
  118.     private $specification;
  119.     /**
  120.      * @var integer
  121.      */
  122.     private $alt_usd_price;
  123.     /**
  124.      * @var string
  125.      */
  126.     private $approved_warranty;
  127.     /**
  128.      * @var string
  129.      */
  130.     private $factory_warranty;
  131.     /**
  132.      * @var string
  133.      */
  134.     private $modification;
  135.     /**
  136.      * @var string
  137.      */
  138.     private $exterior;
  139.     /**
  140.      * @var string
  141.      */
  142.     private $interior_ua;
  143.     /**
  144.      * @var string
  145.      */
  146.     private $interior_ru;
  147.     /**
  148.      * @var Media
  149.      */
  150.     private $file;
  151.     /**
  152.      * @var string
  153.      */
  154.     private $approved_warranty_ua;
  155.     /**
  156.      * @var string
  157.      */
  158.     private $approved_warranty_ru;
  159.     /**
  160.      * @var string
  161.      */
  162.     private $factory_warranty_ua;
  163.     /**
  164.      * @var string
  165.      */
  166.     private $factory_warranty_ru;
  167.     /**
  168.      * @var integer
  169.      */
  170.     private $is_reserved 0;
  171.     /**
  172.      * @var integer
  173.      */
  174.     private $economic_engine 0;
  175.     /**
  176.      * @var integer
  177.      */
  178.     private $excellent_technical_condition 0;
  179.     /**
  180.      * @var integer
  181.      */
  182.     private $official_service 0;
  183.     /**
  184.      * @var integer
  185.      */
  186.     private $additional_rubber 0;
  187.     /**
  188.      * @var integer
  189.      */
  190.     private $under_warranty 0;
  191.     /**
  192.      * @var integer
  193.      */
  194.     private $top_equipment 0;
  195.     /**
  196.      * @var integer
  197.      */
  198.     private $additional_equipment 0;
  199.     /**
  200.      * @var integer
  201.      */
  202.     private $official_car 0;
  203.     /**
  204.      * @var integer
  205.      */
  206.     private $price_with_PDV 0;
  207.     /**
  208.      * @var integer
  209.      */
  210.     private $best_price 0;
  211.     /**
  212.      * @var integer
  213.      */
  214.     private $low_mileage 0;
  215.     /**
  216.      * @var integer
  217.      */
  218.     private $increased_security 0;
  219.     /**
  220.      * @var integer
  221.      */
  222.     private $native_color 0;
  223.     /**
  224.      * Get id
  225.      *
  226.      * @return integer
  227.      */
  228.     public function getId()
  229.     {
  230.         return $this->id;
  231.     }
  232.     /**
  233.      * Set price
  234.      *
  235.      * @param float $price
  236.      *
  237.      * @return VehicleItem
  238.      */
  239.     public function setPrice($price)
  240.     {
  241.         $this->price $price;
  242.         return $this;
  243.     }
  244.     /**
  245.      * Get price
  246.      *
  247.      * @return float
  248.      */
  249.     public function getPrice()
  250.     {
  251.         return $this->price;
  252.     }
  253.     /**
  254.      * Set altPrice
  255.      *
  256.      * @param integer $altPrice
  257.      *
  258.      * @return VehicleItem
  259.      */
  260.     public function setAltPrice($altPrice)
  261.     {
  262.         $this->alt_price $altPrice;
  263.         return $this;
  264.     }
  265.     /**
  266.      * Get altPrice
  267.      *
  268.      * @return integer
  269.      */
  270.     public function getAltPrice()
  271.     {
  272.         return (int)$this->alt_price;
  273.     }
  274.     /**
  275.      * Set altRate
  276.      *
  277.      * @param float $altRate
  278.      *
  279.      * @return VehicleItem
  280.      */
  281.     public function setAltRate($altRate)
  282.     {
  283.         $this->alt_rate $altRate;
  284.         return $this;
  285.     }
  286.     /**
  287.      * Get altRate
  288.      *
  289.      * @return float
  290.      */
  291.     public function getAltRate()
  292.     {
  293.         return $this->alt_rate;
  294.     }
  295.     /**
  296.      * Set preorderPrice
  297.      *
  298.      * @param integer $preorderPrice
  299.      *
  300.      * @return VehicleItem
  301.      */
  302.     public function setPreorderPrice($preorderPrice)
  303.     {
  304.         $this->preorder_price $preorderPrice;
  305.         return $this;
  306.     }
  307.     /**
  308.      * Get preorderPrice
  309.      *
  310.      * @return integer
  311.      */
  312.     public function getPreorderPrice()
  313.     {
  314.         return $this->preorder_price;
  315.     }
  316.     /**
  317.      * Set year
  318.      *
  319.      * @param integer $year
  320.      *
  321.      * @return VehicleItem
  322.      */
  323.     public function setYear($year)
  324.     {
  325.         $this->year $year;
  326.         return $this;
  327.     }
  328.     /**
  329.      * Get year
  330.      *
  331.      * @return integer
  332.      */
  333.     public function getYear()
  334.     {
  335.         return $this->year;
  336.     }
  337.     /**
  338.      * Set mileage
  339.      *
  340.      * @param integer $mileage
  341.      *
  342.      * @return VehicleItem
  343.      */
  344.     public function setMileage($mileage)
  345.     {
  346.         $this->mileage $mileage;
  347.         return $this;
  348.     }
  349.     /**
  350.      * Get mileage
  351.      *
  352.      * @return integer
  353.      */
  354.     public function getMileage()
  355.     {
  356.         return $this->mileage;
  357.     }
  358.     /**
  359.      * Set state
  360.      *
  361.      * @param integer $state
  362.      *
  363.      * @return VehicleItem
  364.      */
  365.     public function setState($state)
  366.     {
  367.         $this->state $state;
  368.         return $this;
  369.     }
  370.     /**
  371.      * @return bool
  372.      */
  373.     public function getState()
  374.     {
  375.         return $this->state 0;
  376.     }
  377.     /**
  378.      * @return bool
  379.      */
  380.     public function isActive()
  381.     {
  382.         return $this->state 0;
  383.     }
  384.     /**
  385.      * Set creator
  386.      *
  387.      * @param User $creator
  388.      *
  389.      * @return VehicleItem
  390.      */
  391.     public function setCreator(User $creator null)
  392.     {
  393.         $this->creator $creator;
  394.         return $this;
  395.     }
  396.     /**
  397.      * Get creator
  398.      *
  399.      * @return User
  400.      */
  401.     public function getCreator()
  402.     {
  403.         return $this->creator;
  404.     }
  405.     /**
  406.      * Set equipment
  407.      *
  408.      * @param Equipment|null $equipment
  409.      *
  410.      * @return VehicleItem
  411.      */
  412.     public function setEquipment(Equipment $equipment null)
  413.     {
  414.         $this->equipment $equipment;
  415.         return $this;
  416.     }
  417.     /**
  418.      * Get equipment
  419.      *
  420.      * @return Equipment
  421.      */
  422.     public function getEquipment()
  423.     {
  424.         return $this->equipment;
  425.     }
  426.     /**
  427.      * Set variation
  428.      *
  429.      * @param Variation|null $variation
  430.      *
  431.      * @return VehicleItem
  432.      */
  433.     public function setVariation(Variation $variation null)
  434.     {
  435.         $this->variation $variation;
  436.         return $this;
  437.     }
  438.     /**
  439.      * Get variation
  440.      *
  441.      * @return Variation
  442.      */
  443.     public function getVariation()
  444.     {
  445.         return $this->variation;
  446.     }
  447.     /**
  448.      * Set specification
  449.      *
  450.      * @param Specification|null $specification
  451.      *
  452.      * @return VehicleItem
  453.      */
  454.     public function setSpecification(Specification $specification null)
  455.     {
  456.         $this->specification $specification;
  457.         return $this;
  458.     }
  459.     /**
  460.      * Get specification
  461.      *
  462.      * @return Specification
  463.      */
  464.     public function getSpecification()
  465.     {
  466.         return $this->specification;
  467.     }
  468.     public function __toString()
  469.     {
  470.         //TODO refactor Negated boolean expression is always false.
  471.         if (!$this->getEquipment() || !$this->getVariation()) {
  472.             return '';
  473.         }
  474.         return $this->getEquipment() . ' [' $this->getVariation()->getTitle() . ']';
  475.     }
  476.     /**
  477.      * @return false|float|int
  478.      */
  479.     public function calcPrice()
  480.     {
  481.         if ($this->getAltPrice()) {
  482.             return $this->getAltPrice();
  483.         }
  484.         if ($this->getAltRate()) {
  485.             $rate $this->getAltRate();
  486.         } else {
  487.             if($this->getVariation()->getVehicle()) {
  488.                 $rate $this->getVariation()->getVehicle()->getDealer()->getRate();
  489.             } else {
  490.                 $rate 0;
  491.             }
  492.         }
  493.         if ($this->getAltUsdPrice()) {
  494.             return ceil($this->getAltUsdPrice() * $rate);
  495.         }
  496.         return ceil($this->getPrice() * $rate);
  497.     }
  498.     public function fullPrice(): float
  499.     {
  500.         return ceil($this->getPrice() * $this->getVariation()->getVehicle()->getDealer()->getRate());
  501.     }
  502.     /**
  503.      * Set vehicle
  504.      *
  505.      * @param Vehicle|null $vehicle
  506.      *
  507.      * @return VehicleItem
  508.      */
  509.     public function setVehicle(Vehicle $vehicle null)
  510.     {
  511.         $this->vehicle $vehicle;
  512.         return $this;
  513.     }
  514.     /**
  515.      * Get vehicle
  516.      *
  517.      * @return Vehicle
  518.      */
  519.     public function getVehicle()
  520.     {
  521.         return $this->vehicle;
  522.     }
  523.     /**
  524.      * Set hasNds
  525.      *
  526.      * @param integer $hasNds
  527.      *
  528.      * @return VehicleItem
  529.      */
  530.     public function setHasNds($hasNds)
  531.     {
  532.         $this->has_nds $hasNds;
  533.         return $this;
  534.     }
  535.     /**
  536.      * @return bool
  537.      */
  538.     public function getHasNds()
  539.     {
  540.         return $this->has_nds 0;
  541.     }
  542.     /**
  543.      * Set sold
  544.      *
  545.      * @param integer $sold
  546.      *
  547.      * @return VehicleItem
  548.      */
  549.     public function setSold($sold)
  550.     {
  551.         $this->sold $sold;
  552.         if ($this->date_of_sale === null && $sold) {
  553.             $this->date_of_sale = new DateTime('now');
  554.         } else {
  555.             $this->date_of_sale null;
  556.         }
  557.         return $this;
  558.     }
  559.     /**
  560.      * @return bool
  561.      */
  562.     public function getSold()
  563.     {
  564.         return $this->sold 0;
  565.     }
  566.     /**
  567.      * Set deposit
  568.      *
  569.      * @param integer $deposit
  570.      *
  571.      * @return VehicleItem
  572.      */
  573.     public function setDeposit($deposit)
  574.     {
  575.         $this->deposit $deposit;
  576.         return $this;
  577.     }
  578.     /**
  579.      * @return bool
  580.      */
  581.     public function getDeposit()
  582.     {
  583.         return $this->deposit 0;
  584.     }
  585.     /**
  586.      * Set rentPrice
  587.      *
  588.      * @param integer $rentPrice
  589.      *
  590.      * @return VehicleItem
  591.      */
  592.     public function setRentPrice($rentPrice)
  593.     {
  594.         $this->rent_price $rentPrice;
  595.         return $this;
  596.     }
  597.     /**
  598.      * Get rentPrice
  599.      *
  600.      * @return integer
  601.      */
  602.     public function getRentPrice()
  603.     {
  604.         return $this->rent_price;
  605.     }
  606.     /**
  607.      * Set singleOwner
  608.      *
  609.      * @param integer $singleOwner
  610.      *
  611.      * @return VehicleItem
  612.      */
  613.     public function setSingleOwner($singleOwner)
  614.     {
  615.         $this->single_owner $singleOwner;
  616.         return $this;
  617.     }
  618.     /**
  619.      * @return bool
  620.      */
  621.     public function getSingleOwner()
  622.     {
  623.         return $this->single_owner 0;
  624.     }
  625.     /**
  626.      * Set serviceBook
  627.      *
  628.      * @param integer $serviceBook
  629.      *
  630.      * @return VehicleItem
  631.      */
  632.     public function setServiceBook($serviceBook)
  633.     {
  634.         $this->service_book $serviceBook;
  635.         return $this;
  636.     }
  637.     /**
  638.      * @return bool
  639.      */
  640.     public function getServiceBook()
  641.     {
  642.         return $this->service_book 0;
  643.     }
  644.     /**
  645.      * Set buyInUkraine
  646.      *
  647.      * @param integer $buyInUkraine
  648.      *
  649.      * @return VehicleItem
  650.      */
  651.     public function setBuyInUkraine($buyInUkraine)
  652.     {
  653.         $this->buy_in_ukraine $buyInUkraine;
  654.         return $this;
  655.     }
  656.     /**
  657.      * @return bool
  658.      */
  659.     public function getBuyInUkraine()
  660.     {
  661.         return $this->buy_in_ukraine 0;
  662.     }
  663.     /**
  664.      * Set noAccident
  665.      *
  666.      * @param integer $noAccident
  667.      *
  668.      * @return VehicleItem
  669.      */
  670.     public function setNoAccident($noAccident)
  671.     {
  672.         $this->no_accident $noAccident;
  673.         return $this;
  674.     }
  675.     /**
  676.      * @return bool
  677.      */
  678.     public function getNoAccident()
  679.     {
  680.         return $this->no_accident 0;
  681.     }
  682.     /**
  683.      * Set altUsdPrice
  684.      *
  685.      * @param integer $altUsdPrice
  686.      *
  687.      * @return VehicleItem
  688.      */
  689.     public function setAltUsdPrice($altUsdPrice)
  690.     {
  691.         $this->alt_usd_price $altUsdPrice;
  692.         return $this;
  693.     }
  694.     /**
  695.      * Get altUsdPrice
  696.      *
  697.      * @return integer
  698.      */
  699.     public function getAltUsdPrice()
  700.     {
  701.         return $this->alt_usd_price;
  702.     }
  703.     /**
  704.      * Set modification
  705.      *
  706.      * @param string $modification
  707.      *
  708.      * @return VehicleItem
  709.      */
  710.     public function setModification($modification)
  711.     {
  712.         $this->modification $modification;
  713.         return $this;
  714.     }
  715.     /**
  716.      * Get modification
  717.      *
  718.      * @return string
  719.      */
  720.     public function getModification()
  721.     {
  722.         return $this->modification;
  723.     }
  724.     /**
  725.      * Set exterior
  726.      *
  727.      * @param string $exterior
  728.      *
  729.      * @return VehicleItem
  730.      */
  731.     public function setExterior($exterior)
  732.     {
  733.         $this->exterior $exterior;
  734.         return $this;
  735.     }
  736.     /**
  737.      * Get exterior
  738.      *
  739.      * @return string
  740.      */
  741.     public function getExterior()
  742.     {
  743.         return $this->exterior;
  744.     }
  745.     /**
  746.      * Set interiorUa
  747.      *
  748.      * @param string $interiorUa
  749.      *
  750.      * @return VehicleItem
  751.      */
  752.     public function setInteriorUa($interiorUa)
  753.     {
  754.         $this->interior_ua $interiorUa;
  755.         return $this;
  756.     }
  757.     /**
  758.      * Get interiorUa
  759.      *
  760.      * @return string
  761.      */
  762.     public function getInteriorUa()
  763.     {
  764.         return $this->interior_ua;
  765.     }
  766.     /**
  767.      * Set interiorRu
  768.      *
  769.      * @param string $interiorRu
  770.      *
  771.      * @return VehicleItem
  772.      */
  773.     public function setInteriorRu($interiorRu)
  774.     {
  775.         $this->interior_ru $interiorRu;
  776.         return $this;
  777.     }
  778.     /**
  779.      * Get interiorRu
  780.      *
  781.      * @return string
  782.      */
  783.     public function getInteriorRu()
  784.     {
  785.         return $this->interior_ru;
  786.     }
  787.     /**
  788.      * Set file
  789.      *
  790.      * @param Media $file
  791.      *
  792.      * @return VehicleItem
  793.      */
  794.     public function setFile(Media $file null)
  795.     {
  796.         $this->file $file;
  797.         return $this;
  798.     }
  799.     /**
  800.      * Get file
  801.      *
  802.      * @return Media
  803.      */
  804.     public function getFile()
  805.     {
  806.         return $this->file;
  807.     }
  808.     /**
  809.      * Set approvedWarrantyUa
  810.      *
  811.      * @param string $approvedWarrantyUa
  812.      *
  813.      * @return VehicleItem
  814.      */
  815.     public function setApprovedWarrantyUa($approvedWarrantyUa)
  816.     {
  817.         $this->approved_warranty_ua $approvedWarrantyUa;
  818.         return $this;
  819.     }
  820.     /**
  821.      * Get approvedWarrantyUa
  822.      *
  823.      * @return string
  824.      */
  825.     public function getApprovedWarrantyUa()
  826.     {
  827.         return $this->approved_warranty_ua;
  828.     }
  829.     /**
  830.      * Set approvedWarrantyRu
  831.      *
  832.      * @param string $approvedWarrantyRu
  833.      *
  834.      * @return VehicleItem
  835.      */
  836.     public function setApprovedWarrantyRu($approvedWarrantyRu)
  837.     {
  838.         $this->approved_warranty_ru $approvedWarrantyRu;
  839.         return $this;
  840.     }
  841.     /**
  842.      * Get approvedWarrantyRu
  843.      *
  844.      * @return string
  845.      */
  846.     public function getApprovedWarrantyRu()
  847.     {
  848.         return $this->approved_warranty_ru;
  849.     }
  850.     /**
  851.      * Set factoryWarrantyUa
  852.      *
  853.      * @param string $factoryWarrantyUa
  854.      *
  855.      * @return VehicleItem
  856.      */
  857.     public function setFactoryWarrantyUa($factoryWarrantyUa)
  858.     {
  859.         $this->factory_warranty_ua $factoryWarrantyUa;
  860.         return $this;
  861.     }
  862.     /**
  863.      * Get factoryWarrantyUa
  864.      *
  865.      * @return string
  866.      */
  867.     public function getFactoryWarrantyUa()
  868.     {
  869.         return $this->factory_warranty_ua;
  870.     }
  871.     /**
  872.      * Set factoryWarrantyRu
  873.      *
  874.      * @param string $factoryWarrantyRu
  875.      *
  876.      * @return VehicleItem
  877.      */
  878.     public function setFactoryWarrantyRu($factoryWarrantyRu)
  879.     {
  880.         $this->factory_warranty_ru $factoryWarrantyRu;
  881.         return $this;
  882.     }
  883.     /**
  884.      * Get factoryWarrantyRu
  885.      *
  886.      * @return string
  887.      */
  888.     public function getFactoryWarrantyRu()
  889.     {
  890.         return $this->factory_warranty_ru;
  891.     }
  892.     public function getFactoryWarranty($locale 'ua')
  893.     {
  894.         return $locale === 'ua' $this->getFactoryWarrantyUa() : $this->getFactoryWarrantyRu();
  895.     }
  896.     public function getApprovedWarranty($locale 'ua')
  897.     {
  898.         return $locale === 'ua' $this->getApprovedWarrantyUa() : $this->getApprovedWarrantyRu();
  899.     }
  900.     public function getInterior($locale 'ua')
  901.     {
  902.         return $locale === 'ua' $this->getInteriorUa() : $this->getInteriorRu();
  903.     }
  904.     /**
  905.      * Set isReserved
  906.      *
  907.      * @param integer $isReserved
  908.      *
  909.      * @return VehicleItem
  910.      */
  911.     public function setIsReserved($isReserved)
  912.     {
  913.         $this->is_reserved $isReserved;
  914.         return $this;
  915.     }
  916.     /**
  917.      * Get isReserved
  918.      *
  919.      * @return integer
  920.      */
  921.     public function getIsReserved()
  922.     {
  923.         return $this->is_reserved 0;
  924.     }
  925.     /**
  926.      * Get credit_min_amount
  927.      *
  928.      * @return integer
  929.      */
  930.     public function getCreditMinAmount()
  931.     {
  932.         return $this->credit_min_amount;
  933.     }
  934.     /**
  935.      * Set credit_min_amount
  936.      *
  937.      * @return VehicleItem
  938.      */
  939.     public function setCreditMinAmount($creditMinAmount)
  940.     {
  941.         $this->credit_min_amount $creditMinAmount;
  942.         return $this;
  943.     }
  944.     /**
  945.      * Get credit_percent
  946.      *
  947.      * @return integer
  948.      */
  949.     public function getCreditPercent()
  950.     {
  951.         return $this->credit_percent;
  952.     }
  953.     /**
  954.      * Set credit_percent
  955.      *
  956.      * @return VehicleItem
  957.      */
  958.     public function setCreditPercent($creditPercent)
  959.     {
  960.         $this->credit_percent $creditPercent;
  961.         return $this;
  962.     }
  963.     /**
  964.      * Set economicEngine
  965.      *
  966.      * @param integer $economicEngine
  967.      *
  968.      * @return VehicleItem
  969.      */
  970.     public function setEconomicEngine($economicEngine)
  971.     {
  972.         $this->economic_engine $economicEngine;
  973.         return $this;
  974.     }
  975.     /**
  976.      * @return bool
  977.      */
  978.     public function getEconomicEngine()
  979.     {
  980.         return $this->economic_engine 0;
  981.     }
  982.     /**
  983.      * Set excellentTechnicalCondition
  984.      *
  985.      * @param integer $excellentTechnicalCondition
  986.      *
  987.      * @return VehicleItem
  988.      */
  989.     public function setExcellentTechnicalCondition($excellentTechnicalCondition)
  990.     {
  991.         $this->excellent_technical_condition $excellentTechnicalCondition;
  992.         return $this;
  993.     }
  994.     /**
  995.      * @return bool
  996.      */
  997.     public function getExcellentTechnicalCondition()
  998.     {
  999.         return $this->excellent_technical_condition 0;
  1000.     }
  1001.     /**
  1002.      * Set officialService
  1003.      *
  1004.      * @param integer $officialService
  1005.      *
  1006.      * @return VehicleItem
  1007.      */
  1008.     public function setOfficialService($officialService)
  1009.     {
  1010.         $this->official_service $officialService;
  1011.         return $this;
  1012.     }
  1013.     /**
  1014.      * @return bool
  1015.      */
  1016.     public function getOfficialService()
  1017.     {
  1018.         return $this->official_service 0;
  1019.     }
  1020.     /**
  1021.      * Set additionalRubber
  1022.      *
  1023.      * @param integer $additionalRubber
  1024.      *
  1025.      * @return VehicleItem
  1026.      */
  1027.     public function setAdditionalRubber($additionalRubber)
  1028.     {
  1029.         $this->additional_rubber $additionalRubber;
  1030.         return $this;
  1031.     }
  1032.     /**
  1033.      * @return bool
  1034.      */
  1035.     public function getAdditionalRubber()
  1036.     {
  1037.         return $this->additional_rubber 0;
  1038.     }
  1039.     /**
  1040.      * Set underWarranty
  1041.      *
  1042.      * @param integer $underWarranty
  1043.      *
  1044.      * @return VehicleItem
  1045.      */
  1046.     public function setUnderWarranty($underWarranty)
  1047.     {
  1048.         $this->under_warranty $underWarranty;
  1049.         return $this;
  1050.     }
  1051.     /**
  1052.      * @return bool
  1053.      */
  1054.     public function getUnderWarranty()
  1055.     {
  1056.         return $this->under_warranty 0;
  1057.     }
  1058.     /**
  1059.      * Set topEquipment
  1060.      *
  1061.      * @param integer $topEquipment
  1062.      *
  1063.      * @return VehicleItem
  1064.      */
  1065.     public function setTopEquipment($topEquipment)
  1066.     {
  1067.         $this->top_equipment $topEquipment;
  1068.         return $this;
  1069.     }
  1070.     /**
  1071.      * Get topEquipment
  1072.      *
  1073.      * @return integer
  1074.      */
  1075.     public function getTopEquipment()
  1076.     {
  1077.         return $this->top_equipment 0;
  1078.     }
  1079.     /**
  1080.      * Set additionalEquipment
  1081.      *
  1082.      * @param integer $additionalEquipment
  1083.      *
  1084.      * @return VehicleItem
  1085.      */
  1086.     public function setAdditionalEquipment($additionalEquipment)
  1087.     {
  1088.         $this->additional_equipment $additionalEquipment;
  1089.         return $this;
  1090.     }
  1091.     /**
  1092.      * Get additionalEquipment
  1093.      *
  1094.      * @return integer
  1095.      */
  1096.     public function getAdditionalEquipment()
  1097.     {
  1098.         return $this->additional_equipment 0;
  1099.     }
  1100.     /**
  1101.      * Set officialCar
  1102.      *
  1103.      * @param integer $officialCar
  1104.      *
  1105.      * @return VehicleItem
  1106.      */
  1107.     public function setOfficialCar($officialCar)
  1108.     {
  1109.         $this->official_car $officialCar;
  1110.         return $this;
  1111.     }
  1112.     /**
  1113.      * @return bool
  1114.      */
  1115.     public function getOfficialCar()
  1116.     {
  1117.         return $this->official_car 0;
  1118.     }
  1119.     /**
  1120.      * Set priceWithPDV
  1121.      *
  1122.      * @param integer $priceWithPDV
  1123.      *
  1124.      * @return VehicleItem
  1125.      */
  1126.     public function setPriceWithPDV($priceWithPDV)
  1127.     {
  1128.         $this->price_with_PDV $priceWithPDV;
  1129.         return $this;
  1130.     }
  1131.     /**
  1132.      * @return bool
  1133.      */
  1134.     public function getPriceWithPDV()
  1135.     {
  1136.         return $this->price_with_PDV 0;
  1137.     }
  1138.     /**
  1139.      * Set bestPrice
  1140.      *
  1141.      * @param integer $bestPrice
  1142.      *
  1143.      * @return VehicleItem
  1144.      */
  1145.     public function setBestPrice($bestPrice)
  1146.     {
  1147.         $this->best_price $bestPrice;
  1148.         return $this;
  1149.     }
  1150.     /**
  1151.      * @return bool
  1152.      */
  1153.     public function getBestPrice()
  1154.     {
  1155.         return $this->best_price 0;
  1156.     }
  1157.     /**
  1158.      * Set lowMileage
  1159.      *
  1160.      * @param integer $lowMileage
  1161.      *
  1162.      * @return VehicleItem
  1163.      */
  1164.     public function setLowMileage($lowMileage)
  1165.     {
  1166.         $this->low_mileage $lowMileage;
  1167.         return $this;
  1168.     }
  1169.     /**
  1170.      * @return bool
  1171.      */
  1172.     public function getLowMileage()
  1173.     {
  1174.         return $this->low_mileage 0;
  1175.     }
  1176.     /**
  1177.      * Set increasedSecurity
  1178.      *
  1179.      * @param integer $increasedSecurity
  1180.      *
  1181.      * @return VehicleItem
  1182.      */
  1183.     public function setIncreasedSecurity($increasedSecurity)
  1184.     {
  1185.         $this->increased_security $increasedSecurity;
  1186.         return $this;
  1187.     }
  1188.     /**
  1189.      * @return bool
  1190.      */
  1191.     public function getIncreasedSecurity()
  1192.     {
  1193.         return $this->increased_security 0;
  1194.     }
  1195.     /**
  1196.      * Set nativeColor
  1197.      *
  1198.      * @param integer $nativeColor
  1199.      *
  1200.      * @return VehicleItem
  1201.      */
  1202.     public function setNativeColor($nativeColor)
  1203.     {
  1204.         $this->native_color $nativeColor;
  1205.         return $this;
  1206.     }
  1207.     /**
  1208.      * @return bool
  1209.      */
  1210.     public function getNativeColor()
  1211.     {
  1212.         return $this->native_color 0;
  1213.     }
  1214.     /**
  1215.      * Set programm
  1216.      *
  1217.      * @param string $programm
  1218.      *
  1219.      * @return VehicleItem
  1220.      */
  1221.     public function setProgramm($programm)
  1222.     {
  1223.         $this->programm $programm;
  1224.         return $this;
  1225.     }
  1226.     /**
  1227.      * Get programm
  1228.      *
  1229.      * @return string
  1230.      */
  1231.     public function getProgramm()
  1232.     {
  1233.         return $this->programm;
  1234.     }
  1235.     /**
  1236.      * Set specifyPrice
  1237.      *
  1238.      * @param boolean $specifyPrice
  1239.      *
  1240.      * @return VehicleItem
  1241.      */
  1242.     public function setSpecifyPrice($specifyPrice)
  1243.     {
  1244.         $this->specify_price $specifyPrice;
  1245.         return $this;
  1246.     }
  1247.     /**
  1248.      * Get specifyPrice
  1249.      *
  1250.      * @return boolean
  1251.      */
  1252.     public function getSpecifyPrice()
  1253.     {
  1254.         return $this->specify_price 0;
  1255.     }
  1256.     /**
  1257.      * Constructor
  1258.      */
  1259.     public function __construct()
  1260.     {
  1261.         $this->offer = new ArrayCollection();
  1262.     }
  1263.     /**
  1264.      * Add offer
  1265.      *
  1266.      * @param ConfiguratorOffer $offer
  1267.      *
  1268.      * @return VehicleItem
  1269.      */
  1270.     public function addOffer(ConfiguratorOffer $offer)
  1271.     {
  1272.         $this->offer[] = $offer;
  1273.         return $this;
  1274.     }
  1275.     /**
  1276.      * Remove offer
  1277.      *
  1278.      * @param ConfiguratorOffer $offer
  1279.      */
  1280.     public function removeOffer(ConfiguratorOffer $offer)
  1281.     {
  1282.         $this->offer->removeElement($offer);
  1283.     }
  1284.     /**
  1285.      * Get offer
  1286.      *
  1287.      * @return Collection
  1288.      */
  1289.     public function getOffer()
  1290.     {
  1291.         return $this->offer;
  1292.     }
  1293.     /**
  1294.      * @var Collection
  1295.      */
  1296.     private $vehicleInStock;
  1297.     /**
  1298.      * Add vehicleInStock
  1299.      *
  1300.      * @param InStock $vehicleInStock
  1301.      *
  1302.      * @return VehicleItem
  1303.      */
  1304.     public function addVehicleInStock(InStock $vehicleInStock)
  1305.     {
  1306.         $this->vehicleInStock[] = $vehicleInStock;
  1307.         return $this;
  1308.     }
  1309.     /**
  1310.      * Remove vehicleInStock
  1311.      *
  1312.      * @param InStock $vehicleInStock
  1313.      */
  1314.     public function removeVehicleInStock(InStock $vehicleInStock)
  1315.     {
  1316.         $this->vehicleInStock->removeElement($vehicleInStock);
  1317.     }
  1318.     /**
  1319.      * Get vehicleInStock
  1320.      *
  1321.      * @return Collection
  1322.      */
  1323.     public function getVehicleInStock()
  1324.     {
  1325.         return $this->vehicleInStock;
  1326.     }
  1327.     /**
  1328.      * @var integer
  1329.      */
  1330.     private $views;
  1331.     /**
  1332.      * Set views
  1333.      *
  1334.      * @param integer $views
  1335.      *
  1336.      * @return VehicleItem
  1337.      */
  1338.     public function setViews($views)
  1339.     {
  1340.         $this->views $views;
  1341.         return $this;
  1342.     }
  1343.     /**
  1344.      * Get views
  1345.      *
  1346.      * @return integer
  1347.      */
  1348.     public function getViews()
  1349.     {
  1350.         return $this->views;
  1351.     }
  1352.     /**
  1353.      * @var DateTime|null
  1354.      */
  1355.     private $date_of_sale;
  1356.     /**
  1357.      * Set dateOfSale.
  1358.      *
  1359.      * @param DateTime|null $dateOfSale
  1360.      *
  1361.      * @return VehicleItem
  1362.      */
  1363.     public function setDateOfSale($dateOfSale null)
  1364.     {
  1365.         $this->date_of_sale $dateOfSale;
  1366.         return $this;
  1367.     }
  1368.     /**
  1369.      * Get dateOfSale.
  1370.      *
  1371.      * @return DateTime|null
  1372.      */
  1373.     public function getDateOfSale()
  1374.     {
  1375.         return $this->date_of_sale;
  1376.     }
  1377. }