src/DcSiteBundle/Entity/Part.php line 13

Open in your IDE?
  1. <?php
  2. namespace DcSiteBundle\Entity;
  3. use CoreBundle\Entity\Dealer;
  4. use Application\Sonata\MediaBundle\Entity\Media;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. /**
  8.  * Part
  9.  */
  10. class Part
  11. {
  12.     /**
  13.      * @var integer
  14.      */
  15.     private $id;
  16.     /**
  17.      * @var string
  18.      */
  19.     private $uid;
  20.     /**
  21.      * @var string
  22.      */
  23.     private $name_ru;
  24.     /**
  25.      * @var string
  26.      */
  27.     private $name_ua;
  28.     /**
  29.      * @var string
  30.      */
  31.     private $content_ru;
  32.     /**
  33.      * @var string
  34.      */
  35.     private $content_ua;
  36.     /**
  37.      * @var integer
  38.      */
  39.     private $count;
  40.     /**
  41.      * @var float
  42.      */
  43.     private $price;
  44.     /**
  45.      * @var integer
  46.      */
  47.     private $is_original;
  48.     /**
  49.      * @var Dealer
  50.      */
  51.     private $dealer;
  52.     /**
  53.      * @var string
  54.      */
  55.     private $title;
  56.     /**
  57.      * @var integer
  58.      */
  59.     private $state;
  60.     /**
  61.      * @var string
  62.      */
  63.     private $number;
  64.     /**
  65.      * @var Media
  66.      */
  67.     private $image;
  68.     /**
  69.      * Get id
  70.      *
  71.      * @return integer
  72.      */
  73.     public function getId()
  74.     {
  75.         return $this->id;
  76.     }
  77.     /**
  78.      * Set uid
  79.      *
  80.      * @param string $uid
  81.      *
  82.      * @return Part
  83.      */
  84.     public function setUid($uid)
  85.     {
  86.         $this->uid $uid;
  87.         return $this;
  88.     }
  89.     /**
  90.      * Get uid
  91.      *
  92.      * @return string
  93.      */
  94.     public function getUid()
  95.     {
  96.         return $this->uid;
  97.     }
  98.     /**
  99.      * Set nameRu
  100.      *
  101.      * @param string $nameRu
  102.      *
  103.      * @return Part
  104.      */
  105.     public function setNameRu($nameRu)
  106.     {
  107.         $this->name_ru $nameRu;
  108.         return $this;
  109.     }
  110.     /**
  111.      * Get nameRu
  112.      *
  113.      * @return string
  114.      */
  115.     public function getNameRu()
  116.     {
  117.         return $this->name_ru;
  118.     }
  119.     /**
  120.      * Set nameUa
  121.      *
  122.      * @param string $nameUa
  123.      *
  124.      * @return Part
  125.      */
  126.     public function setNameUa($nameUa)
  127.     {
  128.         $this->name_ua $nameUa;
  129.         return $this;
  130.     }
  131.     /**
  132.      * Get nameUa
  133.      *
  134.      * @return string
  135.      */
  136.     public function getNameUa()
  137.     {
  138.         return $this->name_ua;
  139.     }
  140.     public function getNameByLocale($locale)
  141.     {
  142.         return $locale == 'ru' $this->name_ru $this->name_ua;
  143.     }
  144.     public function getContentByLocale($locale)
  145.     {
  146.         return $locale == 'ru' $this->content_ru $this->content_ua;
  147.     }
  148.     /**
  149.      * Set count
  150.      *
  151.      * @param integer $count
  152.      *
  153.      * @return Part
  154.      */
  155.     public function setCount($count)
  156.     {
  157.         $this->count $count;
  158.         return $this;
  159.     }
  160.     /**
  161.      * Get count
  162.      *
  163.      * @return integer
  164.      */
  165.     public function getCount()
  166.     {
  167.         return $this->count;
  168.     }
  169.     /**
  170.      * Set price
  171.      *
  172.      * @param float $price
  173.      *
  174.      * @return Part
  175.      */
  176.     public function setPrice($price)
  177.     {
  178.         $this->price $price;
  179.         return $this;
  180.     }
  181.     /**
  182.      * Get price
  183.      *
  184.      * @return float
  185.      */
  186.     public function getPrice()
  187.     {
  188.         return $this->price;
  189.     }
  190.     /**
  191.      * Set isOriginal
  192.      *
  193.      * @param integer $isOriginal
  194.      *
  195.      * @return Part
  196.      */
  197.     public function setIsOriginal($isOriginal)
  198.     {
  199.         $this->is_original $isOriginal;
  200.         return $this;
  201.     }
  202.     /**
  203.      * Get isOriginal
  204.      *
  205.      * @return integer
  206.      */
  207.     public function getIsOriginal()
  208.     {
  209.         return $this->is_original;
  210.     }
  211.     /**
  212.      * Set dealer
  213.      *
  214.      * @param Dealer $dealer
  215.      *
  216.      * @return Part
  217.      */
  218.     public function setDealer(Dealer $dealer null)
  219.     {
  220.         $this->dealer $dealer;
  221.         return $this;
  222.     }
  223.     /**
  224.      * Get dealer
  225.      *
  226.      * @return Dealer
  227.      */
  228.     public function getDealer()
  229.     {
  230.         return $this->dealer;
  231.     }
  232.     public function __toString()
  233.     {
  234.         return (string) '('.$this->number.') '.$this->name_ru;
  235.     }
  236.     /**
  237.      * Set title
  238.      *
  239.      * @param string $title
  240.      *
  241.      * @return Part
  242.      */
  243.     public function setTitle($title)
  244.     {
  245.         $this->title $title;
  246.         return $this;
  247.     }
  248.     /**
  249.      * Get title
  250.      *
  251.      * @return string
  252.      */
  253.     public function getTitle()
  254.     {
  255.         return $this->title;
  256.     }
  257.     /**
  258.      * Set state
  259.      *
  260.      * @param integer $state
  261.      *
  262.      * @return Part
  263.      */
  264.     public function setState($state)
  265.     {
  266.         $this->state $state;
  267.         return $this;
  268.     }
  269.     /**
  270.      * Get state
  271.      *
  272.      * @return integer
  273.      */
  274.     public function getState()
  275.     {
  276.         return $this->state;
  277.     }
  278.     /**
  279.      * Set number
  280.      *
  281.      * @param string $number
  282.      *
  283.      * @return Part
  284.      */
  285.     public function setNumber($number)
  286.     {
  287.         $this->number $number;
  288.         return $this;
  289.     }
  290.     /**
  291.      * Get number
  292.      *
  293.      * @return string
  294.      */
  295.     public function getNumber()
  296.     {
  297.         return $this->number;
  298.     }
  299.     /**
  300.      * @var integer
  301.      */
  302.     private $in_regulation 0;
  303.     /**
  304.      * Set inRegulation
  305.      *
  306.      * @param integer $inRegulation
  307.      *
  308.      * @return Part
  309.      */
  310.     public function setInRegulation($inRegulation)
  311.     {
  312.         $this->in_regulation $inRegulation;
  313.         return $this;
  314.     }
  315.     /**
  316.      * Get inRegulation
  317.      *
  318.      * @return integer
  319.      */
  320.     public function getInRegulation()
  321.     {
  322.         return $this->in_regulation 0;
  323.     }
  324.     /**
  325.      * @param Media $media
  326.      * @return $this
  327.      */
  328.     public function setImage(Media $media null)
  329.     {
  330.         $this->image $media;
  331.         return $this;
  332.     }
  333.     /**
  334.      * @return Media
  335.      */
  336.     public function getImage()
  337.     {
  338.         return $this->image;
  339.     }
  340.     /**
  341.      * Set contentRu
  342.      *
  343.      * @param string $contentRu
  344.      *
  345.      * @return $this
  346.      */
  347.     public function setContentRu($contentRu)
  348.     {
  349.         $this->content_ru $contentRu;
  350.         return $this;
  351.     }
  352.     /**
  353.      * Get contentRu
  354.      *
  355.      * @return string
  356.      */
  357.     public function getContentRu()
  358.     {
  359.         return $this->content_ru;
  360.     }
  361.     /**
  362.      * Set contentUa
  363.      *
  364.      * @param string $contentUa
  365.      *
  366.      * @return $this
  367.      */
  368.     public function setContentUa($contentUa)
  369.     {
  370.         $this->content_ua $contentUa;
  371.         return $this;
  372.     }
  373.     /**
  374.      * Get contentUa
  375.      *
  376.      * @return string
  377.      */
  378.     public function getContentUa()
  379.     {
  380.         return $this->content_ua;
  381.     }
  382.     /**
  383.      * @var integer
  384.      */
  385.     private $is_accessory;
  386.     /**
  387.      * Set isAccessory
  388.      *
  389.      * @param integer $isAccessory
  390.      *
  391.      * @return Part
  392.      */
  393.     public function setIsAccessory($isAccessory)
  394.     {
  395.         $this->is_accessory $isAccessory;
  396.         return $this;
  397.     }
  398.     /**
  399.      * Get isAccessory
  400.      *
  401.      * @return integer
  402.      */
  403.     public function getIsAccessory()
  404.     {
  405.         return $this->is_accessory;
  406.     }
  407.     /**
  408.      * @var string
  409.      */
  410.     private $name;
  411.     /**
  412.      * Set name
  413.      *
  414.      * @param string $name
  415.      *
  416.      * @return Part
  417.      */
  418.     public function setName($name)
  419.     {
  420.         $this->name $name;
  421.         return $this;
  422.     }
  423.     /**
  424.      * Get name
  425.      *
  426.      * @return string
  427.      */
  428.     public function getName()
  429.     {
  430.         return $this->name;
  431.     }
  432.     /**
  433.      * @var Collection
  434.      */
  435.     private $work_parts;
  436.     /**
  437.      * @var Accessories
  438.      */
  439.     private $accessory;
  440.     /**
  441.      * Constructor
  442.      */
  443.     public function __construct()
  444.     {
  445.         $this->work_parts = new ArrayCollection();
  446.     }
  447.     /**
  448.      * Add workPart
  449.      *
  450.      * @param ServiceWorkPart $workPart
  451.      *
  452.      * @return Part
  453.      */
  454.     public function addWorkPart(ServiceWorkPart $workPart)
  455.     {
  456.         $this->work_parts[] = $workPart;
  457.         return $this;
  458.     }
  459.     /**
  460.      * Remove workPart
  461.      *
  462.      * @param ServiceWorkPart $workPart
  463.      */
  464.     public function removeWorkPart(ServiceWorkPart $workPart)
  465.     {
  466.         $this->work_parts->removeElement($workPart);
  467.     }
  468.     /**
  469.      * Get workParts
  470.      *
  471.      * @return Collection
  472.      */
  473.     public function getWorkParts()
  474.     {
  475.         return $this->work_parts;
  476.     }
  477.     /**
  478.      * Set accessory
  479.      *
  480.      * @param Accessories $accessory
  481.      *
  482.      * @return Part
  483.      */
  484.     public function setAccessory(Accessories $accessory null)
  485.     {
  486.         $this->accessory $accessory;
  487.         return $this;
  488.     }
  489.     /**
  490.      * Get accessory
  491.      *
  492.      * @return Accessories
  493.      */
  494.     public function getAccessory()
  495.     {
  496.         return $this->accessory;
  497.     }
  498.     /**
  499.      * @var int
  500.      */
  501.     private $from_new_exchange;
  502.     /**
  503.      * Set fromNewExchange.
  504.      *
  505.      * @param int $fromNewExchange
  506.      *
  507.      * @return Part
  508.      */
  509.     public function setFromNewExchange($fromNewExchange)
  510.     {
  511.         $this->from_new_exchange $fromNewExchange;
  512.         return $this;
  513.     }
  514.     /**
  515.      * Get fromNewExchange.
  516.      *
  517.      * @return int
  518.      */
  519.     public function getFromNewExchange()
  520.     {
  521.         return $this->from_new_exchange;
  522.     }
  523. }