src/DcSiteBundle/Entity/MainSlider.php line 12

Open in your IDE?
  1. <?php
  2. namespace DcSiteBundle\Entity;
  3. use CoreBundle\Entity\Vehicles\Vehicle;
  4. use Application\Sonata\MediaBundle\Entity\Media;
  5. use CoreBundle\Entity\Dealer;
  6. /**
  7.  * MainSlider
  8.  */
  9. class MainSlider
  10. {
  11.     /**
  12.      * @var integer
  13.      */
  14.     private $id;
  15.     /**
  16.      * @var string
  17.      */
  18.     private $url;
  19.     /**
  20.      * @var string
  21.      */
  22.     private $title_ua;
  23.     /**
  24.      * @var string
  25.      */
  26.     private $title_ru;
  27.     /**
  28.      * @var string
  29.      */
  30.     private $sub_title_ua;
  31.     /**
  32.      * @var string
  33.      */
  34.     private $sub_title_ru;
  35.     /**
  36.      * @var int
  37.      */
  38.     private $state;
  39.     /**
  40.      * @var Media
  41.      */
  42.     private $image;
  43.     /**
  44.      * @var Media
  45.      */
  46.     private $image_mobile;
  47.     /**
  48.      * Get id
  49.      *
  50.      * @return integer
  51.      */
  52.     public function getId()
  53.     {
  54.         return $this->id;
  55.     }
  56.     /**
  57.      * Set url
  58.      *
  59.      * @param string $url
  60.      *
  61.      * @return MainSlider
  62.      */
  63.     public function setUrl($url)
  64.     {
  65.         $this->url $url;
  66.         return $this;
  67.     }
  68.     /**
  69.      * Get url
  70.      *
  71.      * @return string
  72.      */
  73.     public function getUrl()
  74.     {
  75.         return $this->url;
  76.     }
  77.     /**
  78.      * @param $locale
  79.      * @return bool|string
  80.      */
  81.     public function buildUrl($locale)
  82.     {
  83.         $url $this->getUrl();
  84.         if(strtolower(substr($url04)) == 'http') {
  85.             return $url;
  86.         }
  87.         if(substr($url,0,1) != '/') {
  88.             $url '/'.$url;;
  89.         }
  90.         if(in_array(substr($url,0,3),['/ru','/ua'])) {
  91.             $urlsubstr($url,3);
  92.         }
  93.         $url '/'.$locale.$url;
  94.         return $url;
  95.     }
  96.     /**
  97.      * @param $locale
  98.      * @return false|string
  99.      */
  100.     public function buildSecondUrl($locale)
  101.     {
  102.         $url $this->getUrlSec();
  103.         if(strtolower(substr($url04)) == 'http') {
  104.             return $url;
  105.         }
  106.         if(substr($url,0,1) != '/') {
  107.             $url '/'.$url;;
  108.         }
  109.         if(in_array(substr($url,0,3),['/ru','/ua'])) {
  110.             $urlsubstr($url,3);
  111.         }
  112.         $url '/'.$locale.$url;
  113.         return $url;
  114.     }
  115.     /**
  116.      * Set state
  117.      *
  118.      * @param integer $state
  119.      *
  120.      * @return MainSlider
  121.      */
  122.     public function setState($state)
  123.     {
  124.         $this->state $state;
  125.         return $this;
  126.     }
  127.     /**
  128.      * Get state
  129.      *
  130.      * @return integer
  131.      */
  132.     public function getState()
  133.     {
  134.         return $this->state 0;
  135.     }
  136.     /**
  137.      * Set image
  138.      *
  139.      * @param Media $image
  140.      *
  141.      * @return MainSlider
  142.      */
  143.     public function setImage(Media $image null)
  144.     {
  145.         $this->image $image;
  146.         return $this;
  147.     }
  148.     /**
  149.      * Get image
  150.      *
  151.      * @return Media
  152.      */
  153.     public function getImage()
  154.     {
  155.         return $this->image;
  156.     }
  157.     /**
  158.      * Set image_mobile
  159.      *
  160.      * @param Media $imageMobile
  161.      *
  162.      * @return MainSlider
  163.      */
  164.     public function setImageMobile(Media $imageMobile null)
  165.     {
  166.         $this->image_mobile $imageMobile;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get image_mobile
  171.      *
  172.      * @return Media
  173.      */
  174.     public function getImageMobile()
  175.     {
  176.         return $this->image_mobile;
  177.     }
  178.     /**
  179.      * @var Dealer
  180.      */
  181.     private $dealer;
  182.     /**
  183.      * Set dealer
  184.      *
  185.      * @param Dealer $dealer
  186.      *
  187.      * @return MainSlider
  188.      */
  189.     public function setDealer(Dealer $dealer null)
  190.     {
  191.         $this->dealer $dealer;
  192.         return $this;
  193.     }
  194.     /**
  195.      * Get dealer
  196.      *
  197.      * @return Dealer
  198.      */
  199.     public function getDealer()
  200.     {
  201.         return $this->dealer;
  202.     }
  203.     public function __toString()
  204.     {
  205.         return (string) $this->title_ru;
  206.     }
  207.     /**
  208.      * Set titleUa
  209.      *
  210.      * @param string $titleUa
  211.      *
  212.      * @return MainSlider
  213.      */
  214.     public function setTitleUa($titleUa)
  215.     {
  216.         $this->title_ua $titleUa;
  217.         return $this;
  218.     }
  219.     /**
  220.      * Get titleUa
  221.      *
  222.      * @return string
  223.      */
  224.     public function getTitleUa()
  225.     {
  226.         return $this->title_ua;
  227.     }
  228.     /**
  229.      * Set titleRu
  230.      *
  231.      * @param string $titleRu
  232.      *
  233.      * @return MainSlider
  234.      */
  235.     public function setTitleRu($titleRu)
  236.     {
  237.         $this->title_ru $titleRu;
  238.         return $this;
  239.     }
  240.     /**
  241.      * Get titleRu
  242.      *
  243.      * @return string
  244.      */
  245.     public function getTitleRu()
  246.     {
  247.         return $this->title_ru;
  248.     }
  249.     /**
  250.      * @param $locale
  251.      * @return string
  252.      */
  253.     public function getTitle($locale) {
  254.         return ($locale == 'ru') ? $this->title_ru $this->title_ua;
  255.     }
  256.     /**
  257.      * Set SubtitleUa
  258.      *
  259.      * @param string titleUa
  260.      *
  261.      * @return MainSlider
  262.      */
  263.     public function setSubTitleUa($subTitleUa)
  264.     {
  265.         $this->sub_title_ua $subTitleUa;
  266.         return $this;
  267.     }
  268.     /**
  269.      * Get SubtitleUa
  270.      *
  271.      * @return string
  272.      */
  273.     public function getSubTitleUa()
  274.     {
  275.         return $this->sub_title_ua;
  276.     }
  277.     /**
  278.      * Set SubtitleRu
  279.      *
  280.      * @param string titleRu
  281.      *
  282.      * @return MainSlider
  283.      */
  284.     public function setSubTitleRu($subTitleRu)
  285.     {
  286.         $this->sub_title_ru $subTitleRu;
  287.         return $this;
  288.     }
  289.     /**
  290.      * Get SubtitleRu
  291.      *
  292.      * @return string
  293.      */
  294.     public function getSubTitleRu()
  295.     {
  296.         return $this->sub_title_ru;
  297.     }
  298.     /**
  299.      * @param $locale
  300.      * @return string
  301.      */
  302.     public function getSubTitle($locale) {
  303.         switch ($locale) {
  304.             case 'ru':
  305.                 return $this->sub_title_ru;
  306.             case 'ua':
  307.                 return $this->sub_title_ua;
  308.         }
  309.         return '';
  310.     }
  311.     /**
  312.      * @var string
  313.      */
  314.     private $btn_fst_title_ru;
  315.     /**
  316.      * @var string
  317.      */
  318.     private $btn_fst_title_ua;
  319.     /**
  320.      * @var string
  321.      */
  322.     private $btn_sec_title_ru;
  323.     /**
  324.      * @var string
  325.      */
  326.     private $btn_sec_title_ua;
  327.     /**
  328.      * @var string
  329.      */
  330.     private $url_sec;
  331.     /**
  332.      * Set btnFstTitleRu
  333.      *
  334.      * @param string btnFstTitleRu
  335.      *
  336.      * @return MainSlider
  337.      */
  338.     public function setBtnFstTitleRu($btnFstTitleRu)
  339.     {
  340.         
  341.         $this->btn_fst_title_ru $btnFstTitleRu;
  342.         return $this;
  343.     }
  344.     /**
  345.      * Get btnFstTitleRu
  346.      *
  347.      * @return string
  348.      */
  349.     public function getBtnFstTitleRu()
  350.     {
  351.         return $this->btn_fst_title_ru;
  352.     }
  353.     /**
  354.      * Set btnFstTitleUa
  355.      *
  356.      * @param string btnFstTitleUa
  357.      *
  358.      * @return MainSlider
  359.      */
  360.     public function setBtnFstTitleUa($btnFstTitleUa)
  361.     {
  362.         $this->btn_fst_title_ua $btnFstTitleUa;
  363.         return $this;
  364.     }
  365.     /**
  366.      * Get btnFstTitleUa
  367.      *
  368.      * @return string
  369.      */
  370.     public function getBtnFstTitleUa()
  371.     {
  372.         return $this->btn_fst_title_ua;
  373.     }
  374.     
  375.     /**
  376.      * @param $locale
  377.      * @return string
  378.      */
  379.     public function getBtnFstTitle($locale) {
  380.         switch ($locale) {
  381.             case 'ru':
  382.                 return $this->btn_fst_title_ru;
  383.             case 'ua':
  384.                 return $this->btn_fst_title_ua;
  385.         }
  386.         return '';
  387.     }
  388.     /**
  389.      * Set btnSecTitleRu
  390.      *
  391.      * @param string $btnSecTitleRu
  392.      *
  393.      * @return MainSlider
  394.      */
  395.     public function setBtnSecTitleRu($btnSecTitleRu)
  396.     {
  397.         $this->btn_sec_title_ru $btnSecTitleRu;
  398.         return $this;
  399.     }
  400.     /**
  401.      * Get btnSecTitleRu
  402.      *
  403.      * @return string
  404.      */
  405.     public function getBtnSecTitleRu()
  406.     {
  407.         return $this->btn_sec_title_ru;
  408.     }
  409.     /**
  410.      * Set btnSecTitleUa
  411.      *
  412.      * @param string $btnSecTitleUa
  413.      *
  414.      * @return MainSlider
  415.      */
  416.     public function setBtnSecTitleUa($btnSecTitleUa)
  417.     {
  418.         $this->btn_sec_title_ua $btnSecTitleUa;
  419.         return $this;
  420.     }
  421.     /**
  422.      * Get btnSecTitleUa
  423.      *
  424.      * @return string
  425.      */
  426.     public function getBtnSecTitleUa()
  427.     {
  428.         return $this->btn_sec_title_ua;
  429.     }
  430.     
  431.     /**
  432.      * @param $locale
  433.      * @return string
  434.      */
  435.     public function getBtnSecTitle($locale) {
  436.         switch ($locale) {
  437.             case 'ru':
  438.                 return $this->btn_sec_title_ru;
  439.             case 'ua':
  440.                 return $this->btn_sec_title_ua;
  441.         }
  442.         return '';
  443.     }
  444.     /**
  445.      * Set urlSec
  446.      *
  447.      * @param string $urlSec
  448.      *
  449.      * @return MainSlider
  450.      */
  451.     public function setUrlSec($urlSec)
  452.     {
  453.         $this->url_sec $urlSec;
  454.         return $this;
  455.     }
  456.     /**
  457.      * Get urlSec
  458.      *
  459.      * @return string
  460.      */
  461.     public function getUrlSec()
  462.     {
  463.         return $this->url_sec;
  464.     }
  465.     /**
  466.      * @var integer
  467.      */
  468.     private $position;
  469.     /**
  470.      * Set position
  471.      *
  472.      * @param integer $position
  473.      *
  474.      * @return MainSlider
  475.      */
  476.     public function setPosition($position)
  477.     {
  478.         $this->position $position;
  479.         return $this;
  480.     }
  481.     /**
  482.      * Get position
  483.      *
  484.      * @return integer
  485.      */
  486.     public function getPosition()
  487.     {
  488.         return $this->position;
  489.     }
  490.     /**
  491.      * @var Vehicle
  492.      */
  493.     private $vehicle;
  494.     /**
  495.      * Set vehicle
  496.      *
  497.      * @param Vehicle $vehicle
  498.      *
  499.      * @return MainSlider
  500.      */
  501.     public function setVehicle(Vehicle $vehicle null)
  502.     {
  503.         $this->vehicle $vehicle;
  504.         return $this;
  505.     }
  506.     /**
  507.      * Get vehicle
  508.      *
  509.      * @return Vehicle
  510.      */
  511.     public function getVehicle()
  512.     {
  513.         return $this->vehicle;
  514.     }
  515.     /**
  516.      * @var string
  517.      */
  518.     private $uid;
  519.     /**
  520.      * Set uid
  521.      *
  522.      * @param string $uid
  523.      *
  524.      * @return MainSlider
  525.      */
  526.     public function setUid($uid)
  527.     {
  528.         $this->uid $uid;
  529.         return $this;
  530.     }
  531.     /**
  532.      * Get uid
  533.      *
  534.      * @return string
  535.      */
  536.     public function getUid()
  537.     {
  538.         return $this->uid;
  539.     }
  540.     /**
  541.      * @var integer
  542.      */
  543.     private $state_title 1;
  544.     /**
  545.      * @var integer
  546.      */
  547.     private $state_sub_title 1;
  548.     /**
  549.      * Set stateTitle
  550.      *
  551.      * @param integer $stateTitle
  552.      *
  553.      * @return MainSlider
  554.      */
  555.     public function setStateTitle($stateTitle)
  556.     {
  557.         $this->state_title $stateTitle;
  558.         return $this;
  559.     }
  560.     /**
  561.      * Get stateTitle
  562.      *
  563.      * @return integer
  564.      */
  565.     public function getStateTitle()
  566.     {
  567.         return $this->state_title 0;
  568.     }
  569.     /**
  570.      * Set stateSubTitle
  571.      *
  572.      * @param integer $stateSubTitle
  573.      *
  574.      * @return MainSlider
  575.      */
  576.     public function setStateSubTitle($stateSubTitle)
  577.     {
  578.         $this->state_sub_title $stateSubTitle;
  579.         return $this;
  580.     }
  581.     /**
  582.      * Get stateSubTitle
  583.      *
  584.      * @return integer
  585.      */
  586.     public function getStateSubTitle()
  587.     {
  588.         return $this->state_sub_title 0;
  589.     }
  590.     /**
  591.      * @var boolean
  592.      */
  593.     private $on_portal;
  594.     /**
  595.      * Set onPortal
  596.      *
  597.      * @param boolean $onPortal
  598.      *
  599.      * @return MainSlider
  600.      */
  601.     public function setOnPortal($onPortal)
  602.     {
  603.         $this->on_portal $onPortal;
  604.         return $this;
  605.     }
  606.     /**
  607.      * Get onPortal
  608.      *
  609.      * @return boolean
  610.      */
  611.     public function getOnPortal()
  612.     {
  613.         return $this->on_portal;
  614.     }
  615. }