TipOfTheDayHistory.php (1464B)
1 <?php 2 3 namespace PartKeepr\TipOfTheDayBundle\Entity; 4 5 use Doctrine\ORM\Mapping as ORM; 6 use PartKeepr\AuthBundle\Entity\User; 7 use PartKeepr\CoreBundle\Entity\BaseEntity; 8 use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService; 9 use Symfony\Component\Serializer\Annotation\Groups; 10 11 /** 12 * Represents a tip of the day history entry. 13 * 14 * This entity stores each tip of the day the user has already seen. 15 * 16 * @ORM\Entity 17 * @TargetService(uri="/api/tip_of_the_day_histories") 18 **/ 19 class TipOfTheDayHistory extends BaseEntity 20 { 21 /** 22 * @ORM\Column(type="string") 23 * @Groups({"default"}) 24 * 25 * @var string 26 */ 27 private $name; 28 29 /** 30 * Defines the user. 31 * 32 * @ORM\ManyToOne(targetEntity="PartKeepr\AuthBundle\Entity\User") 33 * @Groups({"default"}) 34 * 35 * @var \PartKeepr\AuthBundle\Entity\User 36 */ 37 private $user; 38 39 /** 40 * Sets the user for this entry. 41 * 42 * @param User $user 43 */ 44 public function setUser(User $user) 45 { 46 $this->user = $user; 47 } 48 49 /** 50 * @return User 51 */ 52 public function getUser() 53 { 54 return $this->user; 55 } 56 57 /** 58 * Sets the tip of the day name the user already has seen. 59 * 60 * @param string $name The tip name 61 */ 62 public function setName($name) 63 { 64 $this->name = $name; 65 } 66 67 /** 68 * @return string 69 */ 70 public function getName() 71 { 72 return $this->name; 73 } 74 }