src/CoreBundle/Entity/Brand.php line 12

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Application\Sonata\MediaBundle\Entity\Media;
  5. use Doctrine\Common\Collections\Collection;
  6. /**
  7.  * Brand
  8.  */
  9. class Brand
  10. {
  11.     /**
  12.      * @var integer
  13.      */
  14.     private $id;
  15.     /**
  16.      * @var string
  17.      */
  18.     private $name;
  19.     /**
  20.      * @var Collection
  21.      */
  22.     private $dealer;
  23.     /**
  24.      * Constructor
  25.      */
  26.     public function __construct()
  27.     {
  28.         $this->dealer = new ArrayCollection();
  29.     }
  30.     /**
  31.      * Get id
  32.      *
  33.      * @return integer
  34.      */
  35.     public function getId()
  36.     {
  37.         return $this->id;
  38.     }
  39.     /**
  40.      * Set name
  41.      *
  42.      * @param string $name
  43.      *
  44.      * @return Brand
  45.      */
  46.     public function setName($name)
  47.     {
  48.         $this->name $name;
  49.         return $this;
  50.     }
  51.     /**
  52.      * Get name
  53.      *
  54.      * @return string
  55.      */
  56.     public function getName()
  57.     {
  58.         return $this->name;
  59.     }
  60.     /**
  61.      * Add dealer
  62.      *
  63.      * @param Dealer $dealer
  64.      *
  65.      * @return Brand
  66.      */
  67.     public function addDealer(Dealer $dealer)
  68.     {
  69.         $this->dealer[] = $dealer;
  70.         return $this;
  71.     }
  72.     /**
  73.      * Remove dealer
  74.      *
  75.      * @param Dealer $dealer
  76.      */
  77.     public function removeDealer(Dealer $dealer)
  78.     {
  79.         $this->dealer->removeElement($dealer);
  80.     }
  81.     /**
  82.      * Get dealer
  83.      *
  84.      * @return Collection
  85.      */
  86.     public function getDealer()
  87.     {
  88.         return $this->dealer;
  89.     }
  90.     public function __toString()
  91.     {
  92.         return (string) $this->name;
  93.     }
  94.     /**
  95.      * @var Media
  96.      */
  97.     private $image;
  98.     /**
  99.      * Set image
  100.      *
  101.      * @param Media $image
  102.      *
  103.      * @return Brand
  104.      */
  105.     public function setImage(Media $image null)
  106.     {
  107.         $this->image $image;
  108.         return $this;
  109.     }
  110.     /**
  111.      * Get image
  112.      *
  113.      * @return Media
  114.      */
  115.     public function getImage()
  116.     {
  117.         return $this->image;
  118.     }
  119.     /**
  120.      * @var Collection
  121.      */
  122.     private $models;
  123.     /**
  124.      * Add model
  125.      *
  126.      * @param Model $model
  127.      *
  128.      * @return Brand
  129.      */
  130.     public function addModel(Model $model)
  131.     {
  132.         $this->models[] = $model;
  133.         return $this;
  134.     }
  135.     /**
  136.      * Remove model
  137.      *
  138.      * @param Model $model
  139.      */
  140.     public function removeModel(Model $model)
  141.     {
  142.         $this->models->removeElement($model);
  143.     }
  144.     /**
  145.      * Get models
  146.      *
  147.      * @return Collection
  148.      */
  149.     public function getModels()
  150.     {
  151.         return $this->models;
  152.     }
  153.     /**
  154.      * @var Media
  155.      */
  156.     private $logo;
  157.     /**
  158.      * Set logo
  159.      *
  160.      * @param Media $logo
  161.      *
  162.      * @return Brand
  163.      */
  164.     public function setLogo(Media $logo null)
  165.     {
  166.         $this->logo $logo;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get logo
  171.      *
  172.      * @return Media
  173.      */
  174.     public function getLogo()
  175.     {
  176.         return $this->logo;
  177.     }
  178.     /**
  179.      * @var string
  180.      */
  181.     private $crm_name;
  182.     /**
  183.      * @var string
  184.      */
  185.     private $crm_id;
  186.     /**
  187.      * Set crmName
  188.      *
  189.      * @param string $crmName
  190.      *
  191.      * @return Brand
  192.      */
  193.     public function setCrmName($crmName)
  194.     {
  195.         $this->crm_name $crmName;
  196.         return $this;
  197.     }
  198.     /**
  199.      * Get crmName
  200.      *
  201.      * @return string
  202.      */
  203.     public function getCrmName()
  204.     {
  205.         return $this->crm_name;
  206.     }
  207.     /**
  208.      * Set crmId
  209.      *
  210.      * @param string $crmId
  211.      *
  212.      * @return Brand
  213.      */
  214.     public function setCrmId($crmId)
  215.     {
  216.         $this->crm_id $crmId;
  217.         return $this;
  218.     }
  219.     /**
  220.      * Get crmId
  221.      *
  222.      * @return string
  223.      */
  224.     public function getCrmId()
  225.     {
  226.         return $this->crm_id;
  227.     }
  228.     /**
  229.      * @var string
  230.      */
  231.     private $uid_1c;
  232.     /**
  233.      * Set uid1c
  234.      *
  235.      * @param string $uid1c
  236.      *
  237.      * @return Brand
  238.      */
  239.     public function setUid1c($uid1c)
  240.     {
  241.         $this->uid_1c $uid1c;
  242.         return $this;
  243.     }
  244.     /**
  245.      * Get uid1c
  246.      *
  247.      * @return string
  248.      */
  249.     public function getUid1c()
  250.     {
  251.         return $this->uid_1c;
  252.     }
  253.     /**
  254.      * @var string
  255.      */
  256.     private $url;
  257.     /**
  258.      * Set url
  259.      *
  260.      * @param string $url
  261.      *
  262.      * @return Brand
  263.      */
  264.     public function setUrl($url)
  265.     {
  266.         $this->url $url;
  267.         return $this;
  268.     }
  269.     /**
  270.      * Get url
  271.      *
  272.      * @return string
  273.      */
  274.     public function getUrl()
  275.     {
  276.         return $this->url;
  277.     }
  278.     /**
  279.      * @var integer
  280.      */
  281.     private $ria_id;
  282.     /**
  283.      * Set riaId
  284.      *
  285.      * @param integer $riaId
  286.      *
  287.      * @return Brand
  288.      */
  289.     public function setRiaId($riaId)
  290.     {
  291.         $this->ria_id $riaId;
  292.         return $this;
  293.     }
  294.     /**
  295.      * Get riaId
  296.      *
  297.      * @return integer
  298.      */
  299.     public function getRiaId()
  300.     {
  301.         return $this->ria_id;
  302.     }
  303.     /**
  304.      * @var string
  305.      */
  306.     private $name_ru;
  307.     /**
  308.      * @var string
  309.      */
  310.     private $name_ua;
  311.     /**
  312.      * Set nameRu
  313.      *
  314.      * @param string $nameRu
  315.      *
  316.      * @return Brand
  317.      */
  318.     public function setNameRu($nameRu)
  319.     {
  320.         $this->name_ru $nameRu;
  321.         return $this;
  322.     }
  323.     /**
  324.      * Get nameRu
  325.      *
  326.      * @return string
  327.      */
  328.     public function getNameRu()
  329.     {
  330.         return $this->name_ru;
  331.     }
  332.     /**
  333.      * Set nameUa
  334.      *
  335.      * @param string $nameUa
  336.      *
  337.      * @return Brand
  338.      */
  339.     public function setNameUa($nameUa)
  340.     {
  341.         $this->name_ua $nameUa;
  342.         return $this;
  343.     }
  344.     /**
  345.      * Get nameUa
  346.      *
  347.      * @return string
  348.      */
  349.     public function getNameUa()
  350.     {
  351.         return $this->name_ua;
  352.     }
  353.     /**
  354.      * @param $locale
  355.      * @return string
  356.      */
  357.     public function getNameByLocale($locale '')
  358.     {
  359.         if($locale == 'ru') {
  360.             return $this->getNameRu();
  361.         }
  362.         if($locale == 'ua') {
  363.             return $this->getNameUA();
  364.         }
  365.         return $this->getName();
  366.     }
  367.     /**
  368.      * @var Media
  369.      */
  370.     private $logo_white;
  371.     /**
  372.      * Set logoWhite.
  373.      *
  374.      * @param Media|null $logoWhite
  375.      *
  376.      * @return Brand
  377.      */
  378.     public function setLogoWhite(Media $logoWhite null)
  379.     {
  380.         $this->logo_white $logoWhite;
  381.         return $this;
  382.     }
  383.     /**
  384.      * Get logoWhite.
  385.      *
  386.      * @return Media|null
  387.      */
  388.     public function getLogoWhite()
  389.     {
  390.         return $this->logo_white;
  391.     }
  392. }