vendor/webbamboo/spinners-common/src/Entity/RedirectMapCompanies.php line 14

  1. <?php
  2. namespace Webbamboo\SpinnersCommon\Entity;
  3. use Webbamboo\SpinnersCommon\Repository\RedirectMapCompaniesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * RedirectMapCompanies
  7.  *
  8.  * @ORM\Table("RedirectMapCompanies")
  9.  * @ORM\Entity(repositoryClass=RedirectMapCompaniesRepository::class)
  10.  */
  11. class RedirectMapCompanies
  12. {
  13.     /**
  14.      * @var integer
  15.      *
  16.      * @ORM\Column(name="id", type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      *
  24.      * @ORM\Column(name="fromlink", type="string", length=255)
  25.      */
  26.     private $fromlink;
  27.     /**
  28.      * @var integer
  29.      *
  30.      * @ORM\Column(name="cityid", type="integer")
  31.      */
  32.     private $cityid;
  33.     /**
  34.      * @var integer
  35.      *
  36.      * @ORM\Column(name="companyid", type="integer")
  37.      */
  38.     private $companyid;
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(name="tolink", type="string", length=255)
  43.      */
  44.     private $tolink;
  45.     /**
  46.      * Get id
  47.      *
  48.      * @return integer
  49.      */
  50.     public function getId()
  51.     {
  52.         return $this->id;
  53.     }
  54.     /**
  55.      * Set fromlink
  56.      *
  57.      * @param string $fromlink
  58.      *
  59.      * @return 301MapCompanies
  60.      */
  61.     public function setFromlink($fromlink)
  62.     {
  63.         $this->fromlink $fromlink;
  64.         return $this;
  65.     }
  66.     /**
  67.      * Get fromlink
  68.      *
  69.      * @return string
  70.      */
  71.     public function getFromlink()
  72.     {
  73.         return $this->convertToReadable($this->fromlink);
  74.     }
  75.     /**
  76.      * Set cityid
  77.      *
  78.      * @param integer $cityid
  79.      *
  80.      * @return 301MapCompanies
  81.      */
  82.     public function setCityid($cityid)
  83.     {
  84.         $this->cityid $cityid;
  85.         return $this;
  86.     }
  87.     /**
  88.      * Get cityid
  89.      *
  90.      * @return integer
  91.      */
  92.     public function getCityid()
  93.     {
  94.         return $this->cityid;
  95.     }
  96.     /**
  97.      * Set companyid
  98.      *
  99.      * @param integer $companyid
  100.      *
  101.      * @return 301MapCompanies
  102.      */
  103.     public function setCompanyid($companyid)
  104.     {
  105.         $this->companyid $companyid;
  106.         return $this;
  107.     }
  108.     /**
  109.      * Get companyid
  110.      *
  111.      * @return integer
  112.      */
  113.     public function getCompanyid()
  114.     {
  115.         return $this->companyid;
  116.     }
  117.     /**
  118.      * Set tolink
  119.      *
  120.      * @param string $tolink
  121.      *
  122.      * @return 301MapCompanies
  123.      */
  124.     public function setTolink($tolink)
  125.     {
  126.         $this->tolink $tolink;
  127.         return $this;
  128.     }
  129.     /**
  130.      * Get tolink
  131.      *
  132.      * @return string
  133.      */
  134.     public function getTolink()
  135.     {
  136.         return $this->convertToReadable($this->tolink);
  137.     }
  138.     
  139.     private function convertToReadable($string)
  140.     {
  141.         $url=array(
  142.         "%C3%85","%C3%A5",
  143.         "%C3%84","%C3%A4",
  144.         "%C3%96","%C3%B6",
  145.         );
  146.         $char=array(
  147.          "Å","å",
  148.          "Ä","ä",
  149.          "Ö","ö",
  150.         );
  151.         return str_replace($url$char$string);
  152.     }
  153. }