GlobalNamespaceModel.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * @entity
  4. * @table(name="articles")
  5. */
  6. class DoctrineGlobal_Article
  7. {
  8. /**
  9. * @id
  10. * @column(type="int")
  11. */
  12. protected $id;
  13. /**
  14. * @column(type="string")
  15. */
  16. protected $headline;
  17. /**
  18. * @column(type="text")
  19. */
  20. protected $text;
  21. /**
  22. * @ManyToMany(targetEntity="DoctrineGlobal_User")
  23. * @JoinTable(name="author_articles",
  24. * joinColumns={@JoinColumn(name="article_id", referencedColumnName="id")},
  25. * inverseJoinColumns={@JoinColumn(name="author_id", referencedColumnName="id", unique=true)}
  26. * )
  27. */
  28. protected $author;
  29. /**
  30. * @ManyToMany(targetEntity="\DoctrineGlobal_User")
  31. * @JoinTable(name="editor_articles",
  32. * joinColumns={@JoinColumn(name="article_id", referencedColumnName="id")},
  33. * inverseJoinColumns={@JoinColumn(name="editor_id", referencedColumnName="id", unique=true)}
  34. * )
  35. */
  36. protected $editor;
  37. }
  38. /**
  39. * @Entity
  40. * @Table(name="users")
  41. */
  42. class DoctrineGlobal_User
  43. {
  44. /**
  45. * @Id
  46. * @column(type="integer")
  47. * @var int
  48. */
  49. private $id;
  50. /**
  51. * @column(type="string", length=64)
  52. * @var string
  53. */
  54. private $username;
  55. /**
  56. * @column(type="string", length=128)
  57. * @var string
  58. */
  59. private $email;
  60. }