DDC117Editor.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Doctrine\Tests\Models\DDC117;
  3. /**
  4. * @Entity
  5. */
  6. class DDC117Editor
  7. {
  8. /**
  9. * @Id @Column(type="integer") @GeneratedValue
  10. */
  11. public $id;
  12. /**
  13. * @Column(type="string")
  14. */
  15. public $name;
  16. /**
  17. * @ManyToMany(targetEntity="DDC117Translation", inversedBy="reviewedByEditors")
  18. * @JoinTable(
  19. * inverseJoinColumns={
  20. * @JoinColumn(name="article_id", referencedColumnName="article_id"),
  21. * @JoinColumn(name="language", referencedColumnName="language")
  22. * },
  23. * joinColumns={
  24. * @JoinColumn(name="editor_id", referencedColumnName="id")
  25. * }
  26. * )
  27. */
  28. public $reviewingTranslations;
  29. /**
  30. * @ManyToOne(targetEntity="DDC117Translation", inversedBy="lastTranslatedBy")
  31. * @JoinColumns({
  32. * @JoinColumn(name="lt_article_id", referencedColumnName="article_id"),
  33. * @JoinColumn(name="lt_language", referencedColumnName="language")
  34. * })
  35. */
  36. public $lastTranslation;
  37. public function __construct($name = "")
  38. {
  39. $this->name = $name;
  40. $this->reviewingTranslations = new \Doctrine\Common\Collections\ArrayCollection();
  41. }
  42. public function addLastTranslation(DDC117Translation $t)
  43. {
  44. $this->lastTranslation = $t;
  45. $t->lastTranslatedBy[] = $this;
  46. }
  47. }