1 | <?php |
||
10 | class Post |
||
11 | { |
||
12 | /** |
||
13 | * @var int Id |
||
14 | * @Id @Column(type="integer") @GeneratedValue |
||
15 | */ |
||
16 | protected $id; |
||
17 | |||
18 | /** |
||
19 | * @var string Title |
||
20 | * @Column(type="string") |
||
21 | */ |
||
22 | protected $title; |
||
23 | |||
24 | /** |
||
25 | * @var string Slug |
||
26 | * @Column(type="string", unique=true) |
||
27 | */ |
||
28 | protected $slug; |
||
29 | |||
30 | /** |
||
31 | * @var string Content |
||
32 | * @Column(type="text") |
||
33 | */ |
||
34 | protected $content; |
||
35 | |||
36 | /** |
||
37 | * @var DateTime Published at |
||
38 | * @Column(type="datetime") |
||
39 | */ |
||
40 | protected $published_at; |
||
41 | |||
42 | /** |
||
43 | * @var Category Category |
||
44 | * @ManyToOne(targetEntity="Category", inversedBy="posts") |
||
45 | */ |
||
46 | protected $category; |
||
47 | |||
48 | public function getId() |
||
52 | |||
53 | public function getTitle() |
||
57 | |||
58 | public function setTitle($title) |
||
62 | |||
63 | public function getSlug() |
||
67 | |||
68 | public function setSlug($slug) |
||
72 | |||
73 | public function getContent() |
||
77 | |||
78 | public function getShortContent() |
||
82 | |||
83 | public function setContent($content) |
||
87 | |||
88 | public function getPublishedAt() |
||
92 | |||
93 | public function setPublishedAt(DateTime $published_at) |
||
97 | |||
98 | public function setCategory($category) |
||
102 | |||
103 | public function getCategory() |
||
107 | } |
||
108 |