src/Entity/HelpMission.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HelpMissionRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassHelpMissionRepository::class)]
  7. #[ORM\Index(name'IDX_HELP_MISSION_CITY'columns: ['city'])]
  8. class HelpMission
  9. {
  10.     public const STATUS_OPEN 'open';
  11.     public const STATUS_IN_PROGRESS 'in_progress';
  12.     public const STATUS_DONE 'done';
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\ManyToOne]
  18.     #[ORM\JoinColumn(nullablefalseonDelete'CASCADE')]
  19.     private ?User $creator null;
  20.     #[ORM\ManyToOne]
  21.     #[ORM\JoinColumn(nullabletrueonDelete'SET NULL')]
  22.     private ?User $responder null;
  23.     #[ORM\OneToOne]
  24.     #[ORM\JoinColumn(nullabletrueonDelete'SET NULL'uniquetrue)]
  25.     private ?Conversation $conversation null;
  26.     #[ORM\Column(length140)]
  27.     private string $title '';
  28.     #[ORM\Column(typeTypes::TEXT)]
  29.     private string $description '';
  30.     #[ORM\Column(length120options: ['default' => ''])]
  31.     private string $city '';
  32.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLEnullabletrue)]
  33.     private ?\DateTimeImmutable $endAt null;
  34.     #[ORM\Column(length20)]
  35.     private string $status self::STATUS_OPEN;
  36.     #[ORM\Column(length30)]
  37.     private string $usageType 'entraide';
  38.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLE)]
  39.     private ?\DateTimeImmutable $createdAt null;
  40.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLEnullabletrue)]
  41.     private ?\DateTimeImmutable $updatedAt null;
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getCreator(): ?User
  47.     {
  48.         return $this->creator;
  49.     }
  50.     public function setCreator(?User $creator): self
  51.     {
  52.         $this->creator $creator;
  53.         return $this;
  54.     }
  55.     public function getResponder(): ?User
  56.     {
  57.         return $this->responder;
  58.     }
  59.     public function setResponder(?User $responder): self
  60.     {
  61.         $this->responder $responder;
  62.         return $this;
  63.     }
  64.     public function getConversation(): ?Conversation
  65.     {
  66.         return $this->conversation;
  67.     }
  68.     public function setConversation(?Conversation $conversation): self
  69.     {
  70.         $this->conversation $conversation;
  71.         return $this;
  72.     }
  73.     public function getTitle(): string
  74.     {
  75.         return $this->title;
  76.     }
  77.     public function setTitle(string $title): self
  78.     {
  79.         $this->title $title;
  80.         return $this;
  81.     }
  82.     public function getDescription(): string
  83.     {
  84.         return $this->description;
  85.     }
  86.     public function setDescription(string $description): self
  87.     {
  88.         $this->description $description;
  89.         return $this;
  90.     }
  91.     public function getCity(): string
  92.     {
  93.         return $this->city;
  94.     }
  95.     public function setCity(string $city): self
  96.     {
  97.         $this->city mb_substr(trim($city), 0120);
  98.         return $this;
  99.     }
  100.     public function getEndAt(): ?\DateTimeImmutable
  101.     {
  102.         return $this->endAt;
  103.     }
  104.     public function setEndAt(?\DateTimeImmutable $endAt): self
  105.     {
  106.         $this->endAt $endAt;
  107.         return $this;
  108.     }
  109.     public function getStatus(): string
  110.     {
  111.         return $this->status;
  112.     }
  113.     public function setStatus(string $status): self
  114.     {
  115.         $this->status $status;
  116.         return $this;
  117.     }
  118.     public function getUsageType(): string
  119.     {
  120.         return $this->usageType;
  121.     }
  122.     public function setUsageType(string $usageType): self
  123.     {
  124.         $this->usageType $usageType;
  125.         return $this;
  126.     }
  127.     public function getCreatedAt(): ?\DateTimeImmutable
  128.     {
  129.         return $this->createdAt;
  130.     }
  131.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  132.     {
  133.         $this->createdAt $createdAt;
  134.         return $this;
  135.     }
  136.     public function getUpdatedAt(): ?\DateTimeImmutable
  137.     {
  138.         return $this->updatedAt;
  139.     }
  140.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
  141.     {
  142.         $this->updatedAt $updatedAt;
  143.         return $this;
  144.     }
  145. }