vendor/webbamboo/spinners-common/src/Entity/Page.php line 13

  1. <?php
  2. namespace Webbamboo\SpinnersCommon\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Page
  6.  *
  7.  * @ORM\Table("Page")
  8.  * @ORM\Entity
  9.  */
  10. class Page
  11. {
  12.     /**
  13.      * @var integer
  14.      *
  15.      * @ORM\Column(name="id", type="integer")
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @var string
  22.      *
  23.      * @ORM\Column(name="title", type="string", length=255)
  24.      */
  25.     private $title;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="metatitle", type="string", length=255)
  30.      */
  31.     private $metatitle;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="permalink", type="string", length=255)
  36.      */
  37.     private $permalink;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="content", type="text")
  42.      */
  43.     private $content;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="metadescription", type="text")
  48.      */
  49.     private $metadescription;
  50.     /**
  51.      * @var string
  52.      *
  53.      * @ORM\Column(name="menuname", type="string", length=255)
  54.      */
  55.     private $menuname;
  56.     /**
  57.      * @var \DateTime
  58.      *
  59.      * @ORM\Column(name="published", type="datetime")
  60.      */
  61.     private $published;
  62.     /**
  63.      * Get id
  64.      *
  65.      * @return integer
  66.      */
  67.     public function getId()
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function __construct()
  72.     {
  73.         $this->published = new \DateTime();
  74.     }
  75.     /**
  76.      * Set title
  77.      *
  78.      * @param string $title
  79.      * @return Page
  80.      */
  81.     public function setTitle($title)
  82.     {
  83.         $this->title $title;
  84.         return $this;
  85.     }
  86.     /**
  87.      * Get title
  88.      *
  89.      * @return string
  90.      */
  91.     public function getTitle()
  92.     {
  93.         return $this->title;
  94.     }
  95.     /**
  96.      * Set permalink
  97.      *
  98.      * @param string $permalink
  99.      * @return Page
  100.      */
  101.     public function setPermalink($permalink)
  102.     {
  103.         $t strtolower($permalink);
  104.         $url=array(
  105.         "%C3%85","%C3%A5",
  106.         "%C3%84","%C3%A4",
  107.         "%C3%96","%C3%B6",
  108.         );
  109.         $char=array(
  110.          "Å","å",
  111.          "Ä","ä",
  112.          "Ö","ö",
  113.         );
  114.         $str str_replace($char$url$t);
  115.         $str_new str_replace(array(" "",""/"), "-"$str);
  116.         $this->permalink $str_new;
  117.         return $this;
  118.     }
  119.     /**
  120.      * Get permalink
  121.      *
  122.      * @return string
  123.      */
  124.     public function getPermalink()
  125.     {
  126.         return $this->permalink;
  127.     }
  128.     public function getPermalinkP()
  129.     {
  130.         $url=array(
  131.         "%C3%85","%C3%A5",
  132.         "%C3%84","%C3%A4",
  133.         "%C3%96","%C3%B6",
  134.         );
  135.         $char=array(
  136.          "Å","å",
  137.          "Ä","ä",
  138.          "Ö","ö",
  139.         );
  140.         return str_replace($url$char$this->permalink);
  141.     }
  142.     /**
  143.      * Set content
  144.      *
  145.      * @param string $content
  146.      * @return Page
  147.      */
  148.     public function setContent($content)
  149.     {
  150.         $this->content $content;
  151.         return $this;
  152.     }
  153.     /**
  154.      * Get content
  155.      *
  156.      * @return string
  157.      */
  158.     public function getContent()
  159.     {
  160.         return $this->content;
  161.     }
  162.     /**
  163.      * Set published
  164.      *
  165.      * @param \DateTime $published
  166.      * @return Page
  167.      */
  168.     public function setPublished($published)
  169.     {
  170.         $this->published $published;
  171.         return $this;
  172.     }
  173.     /**
  174.      * Get published
  175.      *
  176.      * @return \DateTime
  177.      */
  178.     public function getPublished()
  179.     {
  180.         return $this->published;
  181.     }
  182.     /**
  183.      * Set metatitle
  184.      *
  185.      * @param string $metatitle
  186.      * @return Article
  187.      */
  188.     public function setMetatitle($metatitle)
  189.     {
  190.         $this->metatitle $metatitle;
  191.         return $this;
  192.     }
  193.     /**
  194.      * Get metatitle
  195.      *
  196.      * @return string
  197.      */
  198.     public function getMetatitle()
  199.     {
  200.         return $this->metatitle;
  201.     }
  202.     /**
  203.      * Set metadescription
  204.      *
  205.      * @param string $metadescription
  206.      * @return Page
  207.      */
  208.     public function setMetadescription($metadescription)
  209.     {
  210.         $this->metadescription $metadescription;
  211.         return $this;
  212.     }
  213.     /**
  214.      * Get metadescription
  215.      *
  216.      * @return string
  217.      */
  218.     public function getMetadescription()
  219.     {
  220.         return $this->metadescription;
  221.     }
  222.     /**
  223.      * Set menuname
  224.      *
  225.      * @param string $menuname
  226.      * @return Page
  227.      */
  228.     public function setMenuname($menuname)
  229.     {
  230.         $this->menuname $menuname;
  231.         return $this;
  232.     }
  233.     /**
  234.      * Get menuname
  235.      *
  236.      * @return string
  237.      */
  238.     public function getMenuname()
  239.     {
  240.         return $this->menuname;
  241.     }
  242. }