src/CoreBundle/Entity/Vehicles/Characteristic.php line 11

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity\Vehicles;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. /**
  6.  * Characteristic
  7.  */
  8. class Characteristic
  9. {
  10.     /**
  11.      * @var integer
  12.      */
  13.     private $id;
  14.     /**
  15.      * @var integer
  16.      */
  17.     private $temp_id;
  18.     /**
  19.      * @var string
  20.      */
  21.     private $title_ua;
  22.     /**
  23.      * @var string
  24.      */
  25.     private $title_ru;
  26.     /**
  27.      * @var integer
  28.      */
  29.     private $vehicle_type;
  30.     /**
  31.      * @var integer
  32.      */
  33.     private $characteristic_type;
  34.     /**
  35.      * @var Collection
  36.      */
  37.     private $characteristic_value;
  38.     /**
  39.      * @var CharacteristicGroup
  40.      */
  41.     private $group;
  42.     /**
  43.      * @var integer
  44.      */
  45.     private $is_required;
  46.     /**
  47.      * @var integer
  48.      */
  49.     private $in_filter;
  50.     /**
  51.      * @var string
  52.      */
  53.     private $model_unique;
  54.     /**
  55.      * @var integer
  56.      */
  57.     private $is_main;
  58.     /**
  59.      * Constructor
  60.      */
  61.     public function __construct()
  62.     {
  63.         $this->characteristic_value = new ArrayCollection();
  64.     }
  65.     /**
  66.      * Get id
  67.      *
  68.      * @return integer
  69.      */
  70.     public function getId()
  71.     {
  72.         return $this->id;
  73.     }
  74.     /**
  75.      * Set tempId
  76.      *
  77.      * @param integer $tempId
  78.      *
  79.      * @return Characteristic
  80.      */
  81.     public function setTempId($tempId)
  82.     {
  83.         $this->temp_id $tempId;
  84.         return $this;
  85.     }
  86.     /**
  87.      * Get tempId
  88.      *
  89.      * @return integer
  90.      */
  91.     public function getTempId()
  92.     {
  93.         return $this->temp_id;
  94.     }
  95.     /**
  96.      * Set titleUa
  97.      *
  98.      * @param string $titleUa
  99.      *
  100.      * @return Characteristic
  101.      */
  102.     public function setTitleUa($titleUa)
  103.     {
  104.         $this->title_ua $titleUa;
  105.         return $this;
  106.     }
  107.     /**
  108.      * Get titleUa
  109.      *
  110.      * @return string
  111.      */
  112.     public function getTitleUa()
  113.     {
  114.         return $this->title_ua;
  115.     }
  116.     /**
  117.      * Set titleRu
  118.      *
  119.      * @param string $titleRu
  120.      *
  121.      * @return Characteristic
  122.      */
  123.     public function setTitleRu($titleRu)
  124.     {
  125.         $this->title_ru $titleRu;
  126.         return $this;
  127.     }
  128.     /**
  129.      * Get titleRu
  130.      *
  131.      * @return string
  132.      */
  133.     public function getTitleRu()
  134.     {
  135.         return $this->title_ru;
  136.     }
  137.     /**
  138.      * Set vehicleType
  139.      *
  140.      * @param integer $vehicleType
  141.      *
  142.      * @return Characteristic
  143.      */
  144.     public function setVehicleType($vehicleType)
  145.     {
  146.         $this->vehicle_type $vehicleType;
  147.         return $this;
  148.     }
  149.     /**
  150.      * Get vehicleType
  151.      *
  152.      * @return integer
  153.      */
  154.     public function getVehicleType()
  155.     {
  156.         return $this->vehicle_type;
  157.     }
  158.     /**
  159.      * Set characteristicType
  160.      *
  161.      * @param integer $characteristicType
  162.      *
  163.      * @return Characteristic
  164.      */
  165.     public function setCharacteristicType($characteristicType)
  166.     {
  167.         $this->characteristic_type $characteristicType;
  168.         return $this;
  169.     }
  170.     /**
  171.      * Get characteristicType
  172.      *
  173.      * @return integer
  174.      */
  175.     public function getCharacteristicType()
  176.     {
  177.         return $this->characteristic_type;
  178.     }
  179.     /**
  180.      * Add characteristicValue
  181.      *
  182.      * @param CharacteristicValue $characteristicValue
  183.      *
  184.      * @return Characteristic
  185.      */
  186.     public function addCharacteristicValue(CharacteristicValue $characteristicValue)
  187.     {
  188.         $this->characteristic_value[] = $characteristicValue;
  189.         return $this;
  190.     }
  191.     /**
  192.      * Remove characteristicValue
  193.      *
  194.      * @param CharacteristicValue $characteristicValue
  195.      */
  196.     public function removeCharacteristicValue(CharacteristicValue $characteristicValue)
  197.     {
  198.         $this->characteristic_value->removeElement($characteristicValue);
  199.     }
  200.     /**
  201.      * Get characteristicValue
  202.      *
  203.      * @return Collection
  204.      */
  205.     public function getCharacteristicValue()
  206.     {
  207.         return $this->characteristic_value;
  208.     }
  209.     /**
  210.      * Set group
  211.      *
  212.      * @param CharacteristicGroup $group
  213.      *
  214.      * @return Characteristic
  215.      */
  216.     public function setGroup(CharacteristicGroup $group null)
  217.     {
  218.         $this->group $group;
  219.         return $this;
  220.     }
  221.     /**
  222.      * Get group
  223.      *
  224.      * @return CharacteristicGroup
  225.      */
  226.     public function getGroup()
  227.     {
  228.         return $this->group;
  229.     }
  230.     /**
  231.      * Set isRequired
  232.      *
  233.      * @param integer $isRequired
  234.      *
  235.      * @return Characteristic
  236.      */
  237.     public function setIsRequired($isRequired)
  238.     {
  239.         $this->is_required $isRequired;
  240.         return $this;
  241.     }
  242.     /**
  243.      * Get isRequired
  244.      *
  245.      * @return integer
  246.      */
  247.     public function getIsRequired()
  248.     {
  249.         return $this->is_required 0;
  250.     }
  251.     public function __toString()
  252.     {
  253.         return (string) $this->getTitleRu();
  254.     }
  255.     public function getTitle($locale)
  256.     {
  257.         if ($locale == 'ru') {
  258.             return $this->getTitleRu();
  259.         }
  260.         return $this->getTitleUa();
  261.     }
  262.     /**
  263.      * Set inFilter
  264.      *
  265.      * @param integer $inFilter
  266.      *
  267.      * @return Characteristic
  268.      */
  269.     public function setInFilter($inFilter)
  270.     {
  271.         $this->in_filter $inFilter;
  272.         return $this;
  273.     }
  274.     /**
  275.      * Get inFilter
  276.      *
  277.      * @return integer
  278.      */
  279.     public function getInFilter()
  280.     {
  281.         return $this->in_filter;
  282.     }
  283.     public function getAdminName()
  284.     {
  285.         $title $this->getTitleRu();
  286.         if ($this->getIsRequired()) {
  287.             $title .= ' *';
  288.         }
  289.         return $title;
  290.     }
  291.     public function getGroupName()
  292.     {
  293.         if ($this->getGroup()) {
  294.             return $this->getGroup()->getTitleRu();
  295.         }
  296.         return '';
  297.     }
  298.     /**
  299.      * Set modelUnique
  300.      *
  301.      * @param string $modelUnique
  302.      *
  303.      * @return Characteristic
  304.      */
  305.     public function setModelUnique($modelUnique)
  306.     {
  307.         $this->model_unique $modelUnique;
  308.         return $this;
  309.     }
  310.     /**
  311.      * Get modelUnique
  312.      *
  313.      * @return string
  314.      */
  315.     public function getModelUnique()
  316.     {
  317.         return $this->model_unique;
  318.     }
  319.     /**
  320.      * Set isMain
  321.      *
  322.      * @param integer $isMain
  323.      *
  324.      * @return Characteristic
  325.      */
  326.     public function setIsMain($isMain)
  327.     {
  328.         $this->is_main $isMain;
  329.         return $this;
  330.     }
  331.     /**
  332.      * Get isMain
  333.      *
  334.      * @return integer
  335.      */
  336.     public function getIsMain()
  337.     {
  338.         return $this->is_main;
  339.     }
  340.     /**
  341.      * @var Variation
  342.      */
  343.     private $variation;
  344.     /**
  345.      * Set variation.
  346.      *
  347.      * @param Variation|null $variation
  348.      *
  349.      * @return Characteristic
  350.      */
  351.     public function setVariation(Variation $variation null)
  352.     {
  353.         $this->variation $variation;
  354.         return $this;
  355.     }
  356.     /**
  357.      * Get variation.
  358.      *
  359.      * @return Variation|null
  360.      */
  361.     public function getVariation()
  362.     {
  363.         return $this->variation;
  364.     }
  365.     /**
  366.      * @var Collection
  367.      */
  368.     private $variation_characteristic;
  369.     /**
  370.      * Add variationCharacteristic.
  371.      *
  372.      * @param VariationCharacteristic $variationCharacteristic
  373.      *
  374.      * @return Characteristic
  375.      */
  376.     public function addVariationCharacteristic(VariationCharacteristic $variationCharacteristic)
  377.     {
  378.         $this->variation_characteristic[] = $variationCharacteristic;
  379.         return $this;
  380.     }
  381.     /**
  382.      * Remove variationCharacteristic.
  383.      *
  384.      * @param VariationCharacteristic $variationCharacteristic
  385.      *
  386.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  387.      */
  388.     public function removeVariationCharacteristic(VariationCharacteristic $variationCharacteristic)
  389.     {
  390.         return $this->variation_characteristic->removeElement($variationCharacteristic);
  391.     }
  392.     /**
  393.      * Get variationCharacteristic.
  394.      *
  395.      * @return Collection
  396.      */
  397.     public function getVariationCharacteristic()
  398.     {
  399.         return $this->variation_characteristic;
  400.     }
  401.     /**
  402.      * @var string
  403.      */
  404.     private $url;
  405.     /**
  406.      * Set url
  407.      *
  408.      * @param string $url
  409.      *
  410.      * @return Characteristic
  411.      */
  412.     public function setUrl($url)
  413.     {
  414.         $this->url $url;
  415.         return $this;
  416.     }
  417.     /**
  418.      * Get url
  419.      *
  420.      * @return string
  421.      */
  422.     public function getUrl()
  423.     {
  424.         return $this->url;
  425.     }
  426. }