src/Entity/Core/PublisherPermission.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Entity\User\User;
  5. #[ORM\Table('publisher_permission')]
  6. #[ORM\Entity(repositoryClass: PublisherPermissionRepository::class)]
  7. class PublisherPermission
  8. {
  9. /**
  10. * @var int
  11. */
  12. #[ORM\Column(name: 'id', type: 'integer')]
  13. #[ORM\Id]
  14. #[ORM\GeneratedValue(strategy: 'AUTO')]
  15. private int $id;
  16. /**
  17. * @var User
  18. */
  19. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
  20. #[ORM\ManyToOne(targetEntity: User::class)]
  21. private User $user;
  22. /**
  23. * @var Publisher
  24. */
  25. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
  26. #[ORM\ManyToOne(targetEntity: Publisher::class)]
  27. private Publisher $publisher;
  28. /**
  29. * @var Publication|null
  30. */
  31. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  32. #[ORM\ManyToOne(targetEntity: Publication::class)]
  33. private ?Publication $publication;
  34. /**
  35. * @var bool
  36. */
  37. #[ORM\Column(name: 'editor_permission', type: 'boolean')]
  38. private bool $editorPermission;
  39. public function getId(): int
  40. {
  41. return $this->id;
  42. }
  43. public function setId(int $id): void
  44. {
  45. $this->id = $id;
  46. }
  47. public function getUser(): User
  48. {
  49. return $this->user;
  50. }
  51. public function setUser(User $user): void
  52. {
  53. $this->user = $user;
  54. }
  55. public function getPublisher(): Publisher
  56. {
  57. return $this->publisher;
  58. }
  59. public function setPublisher(Publisher $publisher): void
  60. {
  61. $this->publisher = $publisher;
  62. }
  63. public function getPublication(): ?Publication
  64. {
  65. return $this->publication;
  66. }
  67. public function setPublication(?Publication $publication): void
  68. {
  69. $this->publication = $publication;
  70. }
  71. public function isEditorPermission(): bool
  72. {
  73. return $this->editorPermission;
  74. }
  75. public function setEditorPermission(bool $editorPermission): void
  76. {
  77. $this->editorPermission = $editorPermission;
  78. }
  79. }