src/PortalBundle/Entity/CatalogBanner.php line 10

Open in your IDE?
  1. <?php
  2. namespace PortalBundle\Entity;
  3. use Application\Sonata\MediaBundle\Entity\Media;
  4. /**
  5.  * CatalogBanner
  6.  */
  7. class CatalogBanner
  8. {
  9.     /**
  10.      * @var int
  11.      */
  12.     private $id;
  13.     /**
  14.      * @var bool
  15.      */
  16.     private $state;
  17.     /**
  18.      * @var string
  19.      */
  20.     private $urn;
  21.     /**
  22.      * @var Media
  23.      */
  24.     private $image_ua;
  25.     /**
  26.      * @var Media
  27.      */
  28.     private $image_mobile_ua;
  29.     /**
  30.      * @var Media
  31.      */
  32.     private $image_ru;
  33.     /**
  34.      * @var Media
  35.      */
  36.     private $image_mobile_ru;
  37.     /**
  38.      * Get id.
  39.      *
  40.      * @return int
  41.      */
  42.     public function getId()
  43.     {
  44.         return $this->id;
  45.     }
  46.     /**
  47.      * Set state.
  48.      *
  49.      * @param bool $state
  50.      *
  51.      * @return CatalogBanner
  52.      */
  53.     public function setState($state)
  54.     {
  55.         $this->state $state;
  56.         return $this;
  57.     }
  58.     /**
  59.      * Get state.
  60.      *
  61.      * @return bool
  62.      */
  63.     public function getState()
  64.     {
  65.         return $this->state;
  66.     }
  67.     /**
  68.      * Set urn.
  69.      *
  70.      * @param string $urn
  71.      *
  72.      * @return CatalogBanner
  73.      */
  74.     public function setUrn($urn)
  75.     {
  76.         $this->urn $urn;
  77.         return $this;
  78.     }
  79.     /**
  80.      * Get urn.
  81.      *
  82.      * @return string
  83.      */
  84.     public function getUrn()
  85.     {
  86.         return $this->urn;
  87.     }
  88.     /**
  89.      * Set imageUa.
  90.      *
  91.      * @param Media|null $imageUa
  92.      *
  93.      * @return CatalogBanner
  94.      */
  95.     public function setImageUa(Media $imageUa null)
  96.     {
  97.         $this->image_ua $imageUa;
  98.         return $this;
  99.     }
  100.     /**
  101.      * Get imageUa.
  102.      *
  103.      * @return Media|null
  104.      */
  105.     public function getImageUa()
  106.     {
  107.         return $this->image_ua;
  108.     }
  109.     /**
  110.      * Set imageMobileUa.
  111.      *
  112.      * @param Media|null $imageMobileUa
  113.      *
  114.      * @return CatalogBanner
  115.      */
  116.     public function setImageMobileUa(Media $imageMobileUa null)
  117.     {
  118.         $this->image_mobile_ua $imageMobileUa;
  119.         return $this;
  120.     }
  121.     /**
  122.      * Get imageMobileUa.
  123.      *
  124.      * @return Media|null
  125.      */
  126.     public function getImageMobileUa()
  127.     {
  128.         return $this->image_mobile_ua;
  129.     }
  130.     /**
  131.      * Set imageRu.
  132.      *
  133.      * @param Media|null $imageRu
  134.      *
  135.      * @return CatalogBanner
  136.      */
  137.     public function setImageRu(Media $imageRu null)
  138.     {
  139.         $this->image_ru $imageRu;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get imageRu.
  144.      *
  145.      * @return Media|null
  146.      */
  147.     public function getImageRu()
  148.     {
  149.         return $this->image_ru;
  150.     }
  151.     /**
  152.      * Set imageMobileRu.
  153.      *
  154.      * @param Media|null $imageMobileRu
  155.      *
  156.      * @return CatalogBanner
  157.      */
  158.     public function setImageMobileRu(Media $imageMobileRu null)
  159.     {
  160.         $this->image_mobile_ru $imageMobileRu;
  161.         return $this;
  162.     }
  163.     /**
  164.      * Get imageMobileRu.
  165.      *
  166.      * @return Media|null
  167.      */
  168.     public function getImageMobileRu()
  169.     {
  170.         return $this->image_mobile_ru;
  171.     }
  172.     /**
  173.      * @var string
  174.      */
  175.     private $name;
  176.     /**
  177.      * Set name.
  178.      *
  179.      * @param string $name
  180.      *
  181.      * @return CatalogBanner
  182.      */
  183.     public function setName($name)
  184.     {
  185.         $this->name $name;
  186.         return $this;
  187.     }
  188.     /**
  189.      * Get name.
  190.      *
  191.      * @return string
  192.      */
  193.     public function getName()
  194.     {
  195.         return $this->name;
  196.     }
  197.     /**
  198.      * @var string
  199.      */
  200.     private $btn_link;
  201.     /**
  202.      * @var bool
  203.      */
  204.     private $modal;
  205.     /**
  206.      * Set btnLink.
  207.      *
  208.      * @param string $btnLink
  209.      *
  210.      * @return CatalogBanner
  211.      */
  212.     public function setBtnLink($btnLink)
  213.     {
  214.         $this->btn_link $btnLink;
  215.         return $this;
  216.     }
  217.     /**
  218.      * Get btnLink.
  219.      *
  220.      * @return string
  221.      */
  222.     public function getBtnLink()
  223.     {
  224.         return $this->btn_link;
  225.     }
  226.     /**
  227.      * Set modal.
  228.      *
  229.      * @param bool $modal
  230.      *
  231.      * @return CatalogBanner
  232.      */
  233.     public function setModal($modal)
  234.     {
  235.         $this->modal $modal;
  236.         return $this;
  237.     }
  238.     /**
  239.      * Get modal.
  240.      *
  241.      * @return bool
  242.      */
  243.     public function getModal()
  244.     {
  245.         return $this->modal;
  246.     }
  247.     public function getImageByLocale($locale 'ua')
  248.     {
  249.         if($locale == 'ua'){
  250.             return $this->getImageUa();
  251.         } else {
  252.             return $this->getImageRu();
  253.         }
  254.     }
  255.     public function getImageMobileByLocale($locale 'ua')
  256.     {
  257.         if($locale == 'ua'){
  258.             return $this->getImageMobileUa();
  259.         } else {
  260.             return $this->getImageMobileRu();
  261.         }
  262.     }
  263. }