src/Entity/PageCMS.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Class PageCMS
  7.  *
  8.  * @ORM\Entity
  9.  * @ORM\Table(name="malys_page_cms")
  10.  * @ORM\HasLifecycleCallbacks()
  11.  * @package App\Entity
  12.  */
  13. class PageCMS
  14. {
  15.     /**
  16.      * @var integer
  17.      *
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="slug", type="string", length=255, nullable=false)
  27.      */
  28.     protected $slug;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="title", type="string", length=255, nullable=false)
  33.      */
  34.     protected $title;
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(name="content", type="text", nullable=true)
  39.      */
  40.     protected $content;
  41.     /**
  42.      * @var DateTime
  43.      *
  44.      * @ORM\Column(name="created_at", type="datetime", nullable=false)
  45.      */
  46.     protected $createdAt;
  47.     /**
  48.      * @var DateTime
  49.      *
  50.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  51.      */
  52.     protected $updatedAt;
  53.     /**
  54.      * PageCMS constructor.
  55.      */
  56.     public function __construct()
  57.     {
  58.     }
  59.     /**
  60.      * @return int
  61.      */
  62.     public function getId()
  63.     {
  64.         return $this->id;
  65.     }
  66.     /**
  67.      * @param int $id
  68.      */
  69.     public function setId($id)
  70.     {
  71.         $this->id $id;
  72.     }
  73.     /**
  74.      * @return string
  75.      */
  76.     public function getSlug()
  77.     {
  78.         return $this->slug;
  79.     }
  80.     /**
  81.      * @param string $slug
  82.      */
  83.     public function setSlug($slug)
  84.     {
  85.         $this->slug $slug;
  86.     }
  87.     /**
  88.      * @return string
  89.      */
  90.     public function getTitle()
  91.     {
  92.         return $this->title;
  93.     }
  94.     /**
  95.      * @param string $title
  96.      */
  97.     public function setTitle($title)
  98.     {
  99.         $this->title $title;
  100.     }
  101.     /**
  102.      * @return string
  103.      */
  104.     public function getContent()
  105.     {
  106.         return $this->content;
  107.     }
  108.     /**
  109.      * @param string $content
  110.      */
  111.     public function setContent($content)
  112.     {
  113.         $this->content $content;
  114.     }
  115.     /**
  116.      * @return DateTime
  117.      */
  118.     public function getCreatedAt()
  119.     {
  120.         return $this->createdAt;
  121.     }
  122.     /**
  123.      * Set createdAt
  124.      *
  125.      * @ORM\PrePersist
  126.      */
  127.     public function setCreatedAt()
  128.     {
  129.         $this->createdAt = new DateTime();
  130.         $this->updatedAt = new DateTime();
  131.     }
  132.     /**
  133.      * @return DateTime
  134.      */
  135.     public function getUpdatedAt()
  136.     {
  137.         return $this->updatedAt;
  138.     }
  139.     /**
  140.      * Set updatedAt
  141.      *
  142.      * @ORM\PreUpdate
  143.      */
  144.     public function setUpdatedAt()
  145.     {
  146.         $this->updatedAt = new DateTime();
  147.     }
  148. }