Skip to content

Commit 8b6172a

Browse files
committed
Tell the HydraBundle how to expose Event entities
1 parent bd4de74 commit 8b6172a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/ML/EventApiBundle/Entity/Event.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44

55
use Symfony\Component\Validator\Constraints as Assert;
66
use Doctrine\ORM\Mapping as ORM;
7+
use ML\HydraBundle\Mapping as Hydra;
78

89
/**
910
* Event
1011
*
1112
* @ORM\Table()
1213
* @ORM\Entity
14+
*
15+
* @Hydra\Expose(iri="http://schema.org/Event")
1316
*/
1417
class Event
1518
{
@@ -29,6 +32,8 @@ class Event
2932
*
3033
* @Assert\NotBlank()
3134
* @ORM\Column(name="name", type="string", length=255)
35+
*
36+
* @Hydra\Expose(iri="http://schema.org/name", required=true)
3237
*/
3338
private $name;
3439

@@ -39,6 +44,8 @@ class Event
3944
*
4045
* @Assert\NotBlank()
4146
* @ORM\Column(name="description", type="text")
47+
*
48+
* @Hydra\Expose(iri="http://schema.org/description", required=true)
4249
*/
4350
private $description;
4451

@@ -49,6 +56,8 @@ class Event
4956
*
5057
* @Assert\NotBlank()
5158
* @ORM\Column(name="startDate", type="datetime")
59+
*
60+
* @Hydra\Expose(iri="http://schema.org/startDate", required=true)
5261
*/
5362
private $startDate;
5463

@@ -59,6 +68,8 @@ class Event
5968
*
6069
* @Assert\NotBlank()
6170
* @ORM\Column(name="endDate", type="datetime")
71+
*
72+
* @Hydra\Expose(iri="http://schema.org/endDate", required=true)
6273
*/
6374
private $endDate;
6475

0 commit comments

Comments
 (0)