Clazz.php 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace JMS\Serializer\Tests\Fixtures\Doctrine\SingleTableInheritance;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity
  7. */
  8. class Clazz extends AbstractModel
  9. {
  10. /** @ORM\Id @ORM\GeneratedValue(strategy = "AUTO") @ORM\Column(type = "integer") */
  11. private $id;
  12. /** @ORM\ManyToOne(targetEntity = "JMS\Serializer\Tests\Fixtures\Doctrine\SingleTableInheritance\Teacher") */
  13. private $teacher;
  14. /** @ORM\ManyToMany(targetEntity = "JMS\Serializer\Tests\Fixtures\Doctrine\SingleTableInheritance\Student") */
  15. private $students;
  16. public function __construct(Teacher $teacher, array $students)
  17. {
  18. $this->teacher = $teacher;
  19. $this->students = new ArrayCollection($students);
  20. }
  21. public function getId()
  22. {
  23. return $this->id;
  24. }
  25. public function getTeacher()
  26. {
  27. return $this->teacher;
  28. }
  29. public function getStudents()
  30. {
  31. return $this->students;
  32. }
  33. }