src/Entity/Bus/PassengerAppSetting.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Bus;
  3. use App\Entity\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * Single-row switch controlling whether the public passenger mobile app can
  7. * reach the booking API (see App\EventSubscriber\PassengerAppAvailabilitySubscriber,
  8. * the only thing that reads this). Turning it off doesn't touch staff/clerk
  9. * traffic on the same /bus_api routes - clerks keep booking passengers at
  10. * the counter while the app is dark.
  11. *
  12. * @ORM\Entity(repositoryClass="App\Repository\Bus\PassengerAppSettingRepository")
  13. * @ORM\Table(name="bus_passenger_app_setting")
  14. */
  15. class PassengerAppSetting
  16. {
  17. /**
  18. * @ORM\Id
  19. * @ORM\GeneratedValue(strategy="AUTO")
  20. * @ORM\Column(type="integer")
  21. */
  22. private $id;
  23. /**
  24. * @ORM\Column(type="boolean")
  25. */
  26. private $enabled = true;
  27. /**
  28. * Shown to passengers in the app when enabled is false. Falls back to a
  29. * default message (see the controller) when left blank.
  30. *
  31. * @ORM\Column(type="string", length=255, nullable=true)
  32. */
  33. private $disabledMessage;
  34. /**
  35. * @ORM\Column(type="datetime")
  36. */
  37. private $updatedAt;
  38. /**
  39. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  40. * @ORM\JoinColumn(name="updated_by_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  41. */
  42. private $updatedBy;
  43. public function __construct()
  44. {
  45. $this->updatedAt = new \DateTime();
  46. }
  47. public function getId(): ?int
  48. {
  49. return $this->id;
  50. }
  51. public function isEnabled(): bool
  52. {
  53. return $this->enabled;
  54. }
  55. public function setEnabled(bool $enabled): self
  56. {
  57. $this->enabled = $enabled;
  58. return $this;
  59. }
  60. public function getDisabledMessage(): ?string
  61. {
  62. return $this->disabledMessage;
  63. }
  64. public function setDisabledMessage(?string $disabledMessage): self
  65. {
  66. $this->disabledMessage = $disabledMessage;
  67. return $this;
  68. }
  69. public function getUpdatedAt(): \DateTimeInterface
  70. {
  71. return $this->updatedAt;
  72. }
  73. public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  74. {
  75. $this->updatedAt = $updatedAt;
  76. return $this;
  77. }
  78. public function getUpdatedBy(): ?User
  79. {
  80. return $this->updatedBy;
  81. }
  82. public function setUpdatedBy(?User $updatedBy): self
  83. {
  84. $this->updatedBy = $updatedBy;
  85. return $this;
  86. }
  87. }