src/Entity/Message.php line 155

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MessageRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. #[ORM\Entity(repositoryClassMessageRepository::class)]
  7. class Message
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'string'length255nullabletrue)]
  14.     #[Assert\NotBlank(message"Le titre est obligatoire.")]
  15.     private $titre;
  16.     #[ORM\Column(type'text'nullabletrue)]
  17.     #[Assert\NotBlank(message"Le contenu est obligatoire.")]
  18.     private $contenus;
  19.     #[ORM\Column(type'json'nullabletrue)]
  20.     private ?array $image null;
  21.     #[ORM\Column(type'datetime_immutable')]
  22.     private $createdAt;
  23.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  24.     private $deletedAt;
  25.     #[ORM\Column(type'integer'nullabletrue)]
  26.     private $status;
  27.    #[ORM\Column(type'string'length20nullabletrue)]
  28.    #[Assert\NotBlank(message"Le téléphone est obligatoire.")]
  29.     private $telephone;
  30.    #[ORM\ManyToOne(targetEntityCanal::class)]
  31.    private $id_canal;
  32.    #[ORM\ManyToOne(targetEntityConversation::class)]
  33.    private $id_conversation;
  34.    #[ORM\ManyToOne(targetEntityTypeMessage::class)]
  35.    private $id_type_message;
  36.    #[ORM\Column(type'string'length255nullabletrue)]
  37.    private $audio;
  38.    
  39.    #[ORM\Column(type'string'length255nullabletrue)]
  40.    private $document;
  41.    #[ORM\Column(type'string'length255nullabletrue)]
  42.    private $video;
  43.    #[ORM\Column(type'string'length255nullabletrue)]
  44.    private $latitude;
  45.    #[ORM\Column(type'string'length255nullabletrue)]
  46.    private $longitude;
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getTitre(): ?string
  52.     {
  53.         return $this->titre;
  54.     }
  55.     public function setTitre(?string $titre): self
  56.     {
  57.         $this->titre $titre;
  58.         return $this;
  59.     }
  60.     public function getContenus(): ?string
  61.     {
  62.         return $this->contenus;
  63.     }
  64.     public function setContenus(?string $contenus): self
  65.     {
  66.         $this->contenus $contenus;
  67.         return $this;
  68.     }
  69.     public function getImage(): ?array
  70.     {
  71.         return $this->image;
  72.     }
  73.     public function setImage(?array $image): self
  74.     {
  75.         $this->image $image;
  76.         return $this;
  77.     }
  78.     public function getCreatedAt(): ?\DateTimeImmutable
  79.     {
  80.         return $this->createdAt;
  81.     }
  82.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  83.     {
  84.         $this->createdAt $createdAt;
  85.         return $this;
  86.     }
  87.     public function getDeletedAt(): ?\DateTimeImmutable
  88.     {
  89.         return $this->deletedAt;
  90.     }
  91.     public function setDeletedAt(?\DateTimeImmutable $deletedAt): self
  92.     {
  93.         $this->deletedAt $deletedAt;
  94.         return $this;
  95.     }
  96.     public function getStatus(): ?int
  97.     {
  98.         return $this->status;
  99.     }
  100.     public function setStatus(?int $status): self
  101.     {
  102.         $this->status $status;
  103.         return $this;
  104.     }
  105.       public function getTelephone(): ?string
  106.     {
  107.         return $this->telephone;
  108.     }
  109.     public function setTelephone(?string $telephone): self
  110.     {
  111.         $this->telephone $telephone;
  112.         return $this;
  113.     }
  114.     public function addImage(string $image): self
  115. {
  116.     $images $this->image ?? [];
  117.     $images[] = $image;
  118.     $this->image $images;
  119.     return $this;
  120. }
  121. public function removeImage(string $image): self
  122. {
  123.     if ($this->image !== null) {
  124.         $this->image array_filter(
  125.             $this->image,
  126.             fn ($img) => $img !== $image
  127.         );
  128.     }
  129.     return $this;
  130. }
  131. public function getIdCanal(): ?Canal
  132. {
  133.     return $this->id_canal;
  134. }
  135. public function setIdCanal(?Canal $id_canal): self
  136. {
  137.     $this->id_canal $id_canal;
  138.     return $this;
  139. }
  140. public function getIdConversation(): ?Conversation
  141. {
  142.     return $this->id_conversation;
  143. }
  144. public function setIdConversation(?Conversation $id_conversation): self
  145. {
  146.     $this->id_conversation $id_conversation;
  147.     return $this;
  148. }
  149. public function getIdTypeMessage(): ?TypeMessage
  150. {
  151.     return $this->id_type_message;
  152. }
  153. public function setIdTypeMessage(?TypeMessage $id_type_message): self
  154. {
  155.     $this->id_type_message $id_type_message;
  156.     return $this;
  157. }
  158. public function getAudio(): ?string
  159. {
  160.     return $this->audio;
  161. }
  162. public function setAudio(?string $audio): self
  163. {
  164.     $this->audio $audio;
  165.     return $this;
  166. }
  167. public function getDocument(): ?string
  168. {
  169.     return $this->document;
  170. }
  171. public function setDocument(?string $document): self
  172. {
  173.     $this->document $document;
  174.     return $this;
  175. }
  176. public function getVideo(): ?string
  177. {
  178.     return $this->video;
  179. }
  180. public function setVideo(?string $video): self
  181. {
  182.     $this->video $video;
  183.     return $this;
  184. }
  185. public function getLatitude(): ?string
  186. {
  187.     return $this->latitude;
  188. }
  189. public function setLatitude(?string $latitude): self
  190. {
  191.     $this->latitude $latitude;
  192.     return $this;
  193. }
  194. public function getLongitude(): ?string
  195. {
  196.     return $this->longitude;
  197. }
  198. public function setLongitude(?string $longitude): self
  199. {
  200.     $this->longitude $longitude;
  201.     return $this;
  202. }
  203. }