src/CoreBundle/Entity/TrainingPerformance.php line 20

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\ORM\Mapping\JoinColumn;
  7. use Doctrine\ORM\Mapping\JoinTable;
  8. use Doctrine\ORM\Mapping\ManyToMany;
  9. use Doctrine\ORM\Mapping\ManyToOne;
  10. use Doctrine\ORM\PersistentCollection;
  11. use UserBundle\Entity\User;
  12. /**
  13. * @ORM\Table("training_performance")
  14. * @ORM\Entity(repositoryClass="TrainingPerformanceRepository")
  15. */
  16. class TrainingPerformance extends SessionTypePerformance
  17. {
  18. /** @ManyToOne(targetEntity="Session") */
  19. private $session;
  20. /**
  21. * @ManyToMany(targetEntity="TopicPerformance")
  22. * @JoinTable(name="training_performance_topic_performance",
  23. * joinColumns={@JoinColumn(name="training_performance_id")},
  24. * inverseJoinColumns={@JoinColumn(name="topic_performance_id", unique=true)}
  25. * )
  26. */
  27. private $topicPerformances;
  28. public function __construct(User $student, Session $session)
  29. {
  30. parent::__construct($student);
  31. $this->session = $session;
  32. $this->topicPerformances = new ArrayCollection();
  33. }
  34. /** @return PersistentCollection | ArrayCollection */
  35. public function getTopicPerformances(): Collection
  36. {
  37. return $this->topicPerformances;
  38. }
  39. public function setTopicPerformances(ArrayCollection $topicPerformances): void
  40. {
  41. $this->topicPerformances = $topicPerformances;
  42. }
  43. }