api.emotionhero.com/src/Models/Emotion.php

90 lines
1.4 KiB
PHP

<?php
namespace EmotionHero\Models;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as JMS;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Users
*
* @ORM\Table(name="emotions")
* @ORM\Entity
*/
class Emotion
{
/**
* @var integer
*
* @ORM\Column(name="id",type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
/**
* @var string
* @ORM\Column(unique=true)
*/
private $name;
/**
*
* @var \Doctrine\Common\Collections\Collection
* @ORM\OneToMany(targetEntity="Target", mappedBy="emotion")
* @JMS\Exclude
*/
private $targets;
public function __construct()
{
$this->targets = new ArrayCollection();
}
/**
* Gets the value of id.
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Gets the value of name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Sets the value of name.
*
* @param string $name the name
*
* @return self
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Gets the value of targets.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTargets()
{
return $this->targets;
}
}