Pages.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. namespace Entity;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. //use APY\DataGridBundle\Grid\Mapping as GRID;
  6. /**
  7. * EntityPages
  8. *
  9. * @ORM\@Table(name="pages")
  10. * @ORM\Entity(repositoryClass="Entity\Repository\PagesRepository")
  11. * @ORM\HasLifecycleCallbacks()
  12. * @GRID\Source(columns="id, title")
  13. */
  14. class Pages
  15. {
  16. /**
  17. * @var integer
  18. *
  19. * @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
  20. * @ORM\Id
  21. * @ORM\GeneratedValue(strategy="IDENTITY")
  22. */
  23. private $id;
  24. /**
  25. * @var string
  26. *
  27. * @ORM\Column(name="title", type="string", length=255)
  28. */
  29. private $title;
  30. /**
  31. * @var string
  32. * \@Gedmo\Slug(fields={"title"})
  33. * @ORM\Column(name="slug", type="string", length=255)
  34. */
  35. private $slug;
  36. /**
  37. * @var string
  38. *
  39. * @ORM\Column(name="content", type="text", precision=0, scale=0, nullable=false, unique=false)
  40. */
  41. private $content;
  42. /**
  43. * @var \DateTime
  44. * @ORM\Column(type="datetime")
  45. */
  46. private $created;
  47. /**
  48. * @var \DateTime
  49. * @ORM\Column(type="datetime")
  50. */
  51. private $updated;
  52. public function __construct()
  53. {
  54. $this->setCreated();
  55. $this->setUpdated();
  56. }
  57. /**
  58. * @preUpdate
  59. */
  60. public function setUpdated()
  61. {
  62. $this->updated = new \DateTime();
  63. }
  64. public function setCreated()
  65. {
  66. $this->created = new \DateTime();
  67. }
  68. /**
  69. * Get id
  70. *
  71. * @return integer
  72. */
  73. public function getId()
  74. {
  75. return $this->id;
  76. }
  77. /**
  78. * Set title
  79. *
  80. * @param string $title
  81. * @return EntityPages
  82. */
  83. public function setTitle($title)
  84. {
  85. $this->title = $title;
  86. return $this;
  87. }
  88. /**
  89. * Get title
  90. *
  91. * @return string
  92. */
  93. public function getTitle()
  94. {
  95. return $this->title;
  96. }
  97. /**
  98. * Get slug
  99. *
  100. * @return string
  101. */
  102. public function getSlug()
  103. {
  104. return $this->slug;
  105. }
  106. public function setSlug($slug)
  107. {
  108. $this->slug = $slug;
  109. return $this;
  110. }
  111. /**
  112. * Set content
  113. *
  114. * @param string $content
  115. * @return EntityPages
  116. */
  117. public function setContent($content)
  118. {
  119. $this->content = $content;
  120. return $this;
  121. }
  122. /**
  123. * Get content
  124. *
  125. * @return string
  126. */
  127. public function getContent()
  128. {
  129. return $this->content;
  130. }
  131. }