src/Entity/Camara.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CamaraRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. #[ORM\Entity(repositoryClassCamaraRepository::class)]
  8. #[Vich\Uploadable]
  9. class Camara
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $nombre null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $modelo null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $numeroSerie null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $imei null// ðŸ“± Identificador del módem 4G
  23.     #[Vich\UploadableField(mapping'certificados_camara'fileNameProperty'certificado')]
  24.     private ?File $certificadoFile null// ðŸ“‚ Archivo físico
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $certificado null// ðŸ“œ Nombre del archivo
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $rtspUrl null// ðŸ”¹ URL de streaming RTSP
  29.     #[ORM\Column(type'decimal'precision10scale7nullabletrue)]
  30.     private ?float $latitud null;
  31.     #[ORM\Column(type'decimal'precision10scale7nullabletrue)]
  32.     private ?float $longitud null;
  33.     #[ORM\ManyToOne(targetEntityMandante::class)]
  34.     #[ORM\JoinColumn(nullabletrueonDelete"SET NULL")]
  35.     private ?Mandante $mandante null;
  36.     #[ORM\Column(options: ["default" => true])]
  37.     private ?bool $activo true;
  38.     #[ORM\Column(type'datetime'nullabletrue)]
  39.     private ?\DateTimeInterface $updatedAt null;
  40.     // === Getters & Setters ===
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getNombre(): ?string
  46.     {
  47.         return $this->nombre;
  48.     }
  49.     public function setNombre(string $nombre): static
  50.     {
  51.         $this->nombre $nombre;
  52.         return $this;
  53.     }
  54.     public function getModelo(): ?string
  55.     {
  56.         return $this->modelo;
  57.     }
  58.     public function setModelo(?string $modelo): static
  59.     {
  60.         $this->modelo $modelo;
  61.         return $this;
  62.     }
  63.     public function getNumeroSerie(): ?string
  64.     {
  65.         return $this->numeroSerie;
  66.     }
  67.     public function setNumeroSerie(?string $numeroSerie): static
  68.     {
  69.         $this->numeroSerie $numeroSerie;
  70.         return $this;
  71.     }
  72.     public function getImei(): ?string
  73.     {
  74.         return $this->imei;
  75.     }
  76.     public function setImei(?string $imei): static
  77.     {
  78.         $this->imei $imei;
  79.         return $this;
  80.     }
  81.     public function getCertificadoFile(): ?File
  82.     {
  83.         return $this->certificadoFile;
  84.     }
  85.     public function setCertificadoFile(?File $file null): void
  86.     {
  87.         $this->certificadoFile $file;
  88.         if ($file) {
  89.             $this->updatedAt = new \DateTimeImmutable();
  90.         }
  91.     }
  92.     public function getCertificado(): ?string
  93.     {
  94.         return $this->certificado;
  95.     }
  96.     public function setCertificado(?string $certificado): static
  97.     {
  98.         $this->certificado $certificado;
  99.         return $this;
  100.     }
  101.     public function getRtspUrl(): ?string
  102.     {
  103.         return $this->rtspUrl;
  104.     }
  105.     public function setRtspUrl(?string $rtspUrl): static
  106.     {
  107.         $this->rtspUrl $rtspUrl;
  108.         return $this;
  109.     }
  110.     public function getLatitud(): ?float
  111.     {
  112.         return $this->latitud;
  113.     }
  114.     public function setLatitud(?float $latitud): static
  115.     {
  116.         $this->latitud $latitud;
  117.         return $this;
  118.     }
  119.     public function getLongitud(): ?float
  120.     {
  121.         return $this->longitud;
  122.     }
  123.     public function setLongitud(?float $longitud): static
  124.     {
  125.         $this->longitud $longitud;
  126.         return $this;
  127.     }
  128.     public function getMandante(): ?Mandante
  129.     {
  130.         return $this->mandante;
  131.     }
  132.     public function setMandante(?Mandante $mandante): static
  133.     {
  134.         $this->mandante $mandante;
  135.         return $this;
  136.     }
  137.     public function isActivo(): ?bool
  138.     {
  139.         return $this->activo;
  140.     }
  141.     public function setActivo(bool $activo): static
  142.     {
  143.         $this->activo $activo;
  144.         return $this;
  145.     }
  146.     public function getUpdatedAt(): ?\DateTimeInterface
  147.     {
  148.         return $this->updatedAt;
  149.     }
  150.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  151.     {
  152.         $this->updatedAt $updatedAt;
  153.         return $this;
  154.     }
  155. }