src/Entity/CotizacionWebObservations.php line 16

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. // CORRECCIÓN: Importar la clase correcta para que el constructor y getters la reconozcan
  5. use App\MDS\VenuesBundle\Entity\Reservation;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity()
  10.  * @ORM\Table(name="cotizacion_web_observations")
  11.  */
  12. class CotizacionWebObservations
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private ?int $id = null;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity="App\MDS\VenuesBundle\Entity\Reservation")
  22.      * @ORM\JoinColumn(name="reservation_id", referencedColumnName="id", onDelete="CASCADE")
  23.      */
  24.     private Reservation $reservation; // Añadido tipado de propiedad nativo de PHP 7.4+
  25.     /**
  26.      * @ORM\Column(type="text")
  27.      */
  28.     private string $observation;
  29.     /**
  30.      * @ORM\Column(type="datetime")
  31.      */
  32.     private \DateTimeInterface $createdAt;
  33.     public function __construct(Reservation $reservation, string $observation)
  34.     {
  35.         $this->reservation = $reservation;
  36.         $this->observation = $observation;
  37.         $this->createdAt = new \DateTimeImmutable();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getReservation(): Reservation
  44.     {
  45.         return $this->reservation;
  46.     }
  47.     public function getObservation(): string
  48.     {
  49.         return $this->observation;
  50.     }
  51.     public function getCreatedAt(): \DateTimeInterface
  52.     {
  53.         return $this->createdAt;
  54.     }
  55. }