src/Entity/Core/Publisher.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core;
  3. use Doctrine\Common\Collections\Collection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Table('publisher')]
  6. #[ORM\Entity(repositoryClass: PublisherRepository::class)]
  7. class Publisher
  8. {
  9. /**
  10. * @var int
  11. */
  12. #[ORM\Column(name: 'id', type: 'integer')]
  13. #[ORM\Id]
  14. private int $id;
  15. /**
  16. * @var string
  17. */
  18. #[ORM\Column(name: 'customer_id', type: 'string', length: 255, unique: true)]
  19. private string $customerId;
  20. /**
  21. * @var string
  22. */
  23. #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)]
  24. private string $name;
  25. /**
  26. * @var int
  27. */
  28. #[ORM\Column]
  29. private int $timestamp;
  30. /**
  31. * @var bool
  32. */
  33. #[ORM\Column]
  34. private bool $deleted;
  35. /**
  36. * @var bool
  37. */
  38. #[ORM\Column]
  39. private bool $hidden;
  40. /**
  41. * @var Collection
  42. */
  43. #[ORM\OneToMany(targetEntity: Publication::class, mappedBy: 'publisher', cascade: ['persist'])]
  44. private Collection $publications;
  45. public function getId(): int
  46. {
  47. return $this->id;
  48. }
  49. public function setId(int $id): void
  50. {
  51. $this->id = $id;
  52. }
  53. public function getName(): string
  54. {
  55. return $this->name;
  56. }
  57. public function getDisplayName(): string
  58. {
  59. return $this->name === '' ? $this->customerId : $this->name;
  60. }
  61. public function setName(string $name): void
  62. {
  63. $this->name = $name;
  64. }
  65. public function __toString(): string
  66. {
  67. return $this->name;
  68. }
  69. public function getPublications(): Collection
  70. {
  71. return $this->publications;
  72. }
  73. public function setPublications(Collection $publications): void
  74. {
  75. $this->publications = $publications;
  76. }
  77. public function getCustomerId(): string
  78. {
  79. return $this->customerId;
  80. }
  81. public function setCustomerId(string $customerId): void
  82. {
  83. $this->customerId = $customerId;
  84. }
  85. public function getTimestamp(): int
  86. {
  87. return $this->timestamp;
  88. }
  89. public function setTimestamp(int $timestamp): void
  90. {
  91. $this->timestamp = $timestamp;
  92. }
  93. public function isDeleted(): bool
  94. {
  95. return $this->deleted;
  96. }
  97. public function setDeleted(bool $deleted): void
  98. {
  99. $this->deleted = $deleted;
  100. }
  101. public function isHidden(): bool
  102. {
  103. return $this->hidden;
  104. }
  105. public function setHidden(bool $hidden): void
  106. {
  107. $this->hidden = $hidden;
  108. }
  109. }