Skip to content

Commit

Permalink
Tell the HydraBundle how to expose Event entities
Browse files Browse the repository at this point in the history
  • Loading branch information
lanthaler committed Jul 20, 2014
1 parent bd4de74 commit 8b6172a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ML/EventApiBundle/Entity/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
use ML\HydraBundle\Mapping as Hydra;

/**
* Event
*
* @ORM\Table()
* @ORM\Entity
*
* @Hydra\Expose(iri="http://schema.org/Event")
*/
class Event
{
Expand All @@ -29,6 +32,8 @@ class Event
*
* @Assert\NotBlank()
* @ORM\Column(name="name", type="string", length=255)
*
* @Hydra\Expose(iri="http://schema.org/name", required=true)
*/
private $name;

Expand All @@ -39,6 +44,8 @@ class Event
*
* @Assert\NotBlank()
* @ORM\Column(name="description", type="text")
*
* @Hydra\Expose(iri="http://schema.org/description", required=true)
*/
private $description;

Expand All @@ -49,6 +56,8 @@ class Event
*
* @Assert\NotBlank()
* @ORM\Column(name="startDate", type="datetime")
*
* @Hydra\Expose(iri="http://schema.org/startDate", required=true)
*/
private $startDate;

Expand All @@ -59,6 +68,8 @@ class Event
*
* @Assert\NotBlank()
* @ORM\Column(name="endDate", type="datetime")
*
* @Hydra\Expose(iri="http://schema.org/endDate", required=true)
*/
private $endDate;

Expand Down

0 comments on commit 8b6172a

Please sign in to comment.