src/Entity/Banners.php line 9

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BannersRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: BannersRepository::class)]
  6. class Banners
  7. {
  8. #[ORM\Id]
  9. #[ORM\GeneratedValue]
  10. #[ORM\Column(type: 'integer')]
  11. private $id;
  12. #[ORM\ManyToOne(targetEntity: Pages::class, inversedBy: 'banners')]
  13. private $page;
  14. #[ORM\Column(type: 'string', length: 255)]
  15. private $name;
  16. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  17. private $alt;
  18. #[ORM\Column(type: 'datetime')]
  19. private $modified;
  20. #[ORM\Column(type: 'datetime')]
  21. private $created;
  22. #[ORM\Column(type: 'boolean')]
  23. private $isPublished;
  24. #[ORM\Column(type: 'boolean')]
  25. private $isDefault;
  26. #[ORM\Column(type: 'integer')]
  27. private $orderBy;
  28. #[ORM\Column(type: 'text', nullable: true)]
  29. private $caption;
  30. public function __construct()
  31. {
  32. $date = new \DateTime("now", new \DateTimeZone('Asia/Dubai'));
  33. $this->setModified($date);
  34. if ($this->getCreated() == null)
  35. {
  36. $this->setCreated($date);
  37. }
  38. }
  39. public function getId(): ?int
  40. {
  41. return $this->id;
  42. }
  43. public function getPage(): ?Pages
  44. {
  45. return $this->page;
  46. }
  47. public function setPage(?Pages $page): self
  48. {
  49. $this->page = $page;
  50. return $this;
  51. }
  52. public function getName(): ?string
  53. {
  54. return $this->name;
  55. }
  56. public function setName(string $name): self
  57. {
  58. $this->name = $name;
  59. return $this;
  60. }
  61. public function getAlt(): ?string
  62. {
  63. return $this->alt;
  64. }
  65. public function setAlt(?string $alt): self
  66. {
  67. $this->alt = $alt;
  68. return $this;
  69. }
  70. public function getModified(): ?\DateTimeInterface
  71. {
  72. return $this->modified;
  73. }
  74. public function setModified(\DateTimeInterface $modified): self
  75. {
  76. $this->modified = $modified;
  77. return $this;
  78. }
  79. public function getCreated(): ?\DateTimeInterface
  80. {
  81. return $this->created;
  82. }
  83. public function setCreated(\DateTimeInterface $created): self
  84. {
  85. $this->created = $created;
  86. return $this;
  87. }
  88. public function isIsPublished(): ?bool
  89. {
  90. return $this->isPublished;
  91. }
  92. public function setIsPublished(bool $isPublished): self
  93. {
  94. $this->isPublished = $isPublished;
  95. return $this;
  96. }
  97. public function getIsDefault(): ?bool
  98. {
  99. return $this->isDefault;
  100. }
  101. public function setIsDefault(bool $isDefault): self
  102. {
  103. $this->isDefault = $isDefault;
  104. return $this;
  105. }
  106. public function getOrderBy(): ?int
  107. {
  108. return $this->orderBy;
  109. }
  110. public function setOrderBy(int $orderBy): self
  111. {
  112. $this->orderBy = $orderBy;
  113. return $this;
  114. }
  115. public function getCaption(): ?string
  116. {
  117. return $this->caption;
  118. }
  119. public function setCaption(?string $caption): self
  120. {
  121. $this->caption = $caption;
  122. return $this;
  123. }
  124. }