src/Entity/InsuranceDisasterDeclaration.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass"App\Repository\InsuranceDisasterDeclarationRepository")]
  6. #[ORM\Table(name'insurance_disaster_declaration')]
  7. class InsuranceDisasterDeclaration {
  8.     #[ORM\Column(type"boolean")]
  9.     private bool $isDeleted false;
  10.     #[ORM\Column(name"createdAt"type"datetime")]
  11.     private DateTime $createdAt;
  12.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy"insuranceDisasterDeclarations"cascade: ["persist"])]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private User $user;
  15.     #[ORM\Column(name"id"type"integer")]
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue(strategy"AUTO")]
  18.     private ?int $id;
  19.     #[ORM\ManyToOne(targetEntitySteal::class, inversedBy"insuranceDisasterDeclarations"cascade: ["persist"])]
  20.     #[ORM\JoinColumn(nullabletrue)]
  21.     private ?Steal $steal;
  22.     #[ORM\ManyToOne(targetEntityComplaintLetter::class, inversedBy"insuranceDisasterDeclarations"cascade: ["persist"])]
  23.     #[ORM\JoinColumn(nullabletrue)]
  24.     private ?ComplaintLetter $complaintLetter;
  25.     public function __construct() {
  26.         $this->createdAt = new DateTime();
  27.     }
  28.     public function __toString() {
  29.         return "#" $this->id " - " $this->createdAt->format("d/m/Y H:i");
  30.     }
  31.     /**
  32.      * Get id
  33.      *
  34.      * @return int
  35.      */
  36.     public function getId() {
  37.         return $this->id;
  38.     }
  39.     /**
  40.      * Set createdAt
  41.      *
  42.      * @param DateTime $createdAt
  43.      *
  44.      * @return InsuranceDisasterDeclaration
  45.      */
  46.     public function setCreatedAt($createdAt) {
  47.         $this->createdAt $createdAt;
  48.         return $this;
  49.     }
  50.     /**
  51.      * Get createdAt
  52.      *
  53.      * @return DateTime
  54.      */
  55.     public function getCreatedAt() {
  56.         return $this->createdAt;
  57.     }
  58.     /**
  59.      * Set steal
  60.      *
  61.      * @param \App\Entity\Steal $steal
  62.      *
  63.      * @return InsuranceDisasterDeclaration
  64.      */
  65.     public function setSteal(\App\Entity\Steal $steal) {
  66.         $this->steal $steal;
  67.         return $this;
  68.     }
  69.     /**
  70.      * Get steal
  71.      *
  72.      * @return \App\Entity\Steal
  73.      */
  74.     public function getSteal() {
  75.         return $this->steal;
  76.     }
  77.     /**
  78.      * Set user
  79.      *
  80.      * @param \App\Entity\User $user
  81.      *
  82.      * @return InsuranceDisasterDeclaration
  83.      */
  84.     public function setUser(\App\Entity\User $user) {
  85.         $this->user $user;
  86.         return $this;
  87.     }
  88.     /**
  89.      * Get user
  90.      *
  91.      * @return \App\Entity\User
  92.      */
  93.     public function getUser() {
  94.         return $this->user;
  95.     }
  96.     /**
  97.      * Set complaintLetter
  98.      *
  99.      * @param \App\Entity\ComplaintLetter $complaintLetter
  100.      *
  101.      * @return InsuranceDisasterDeclaration
  102.      */
  103.     public function setComplaintLetter(\App\Entity\ComplaintLetter $complaintLetter null) {
  104.         $this->complaintLetter $complaintLetter;
  105.         return $this;
  106.     }
  107.     /**
  108.      * Get complaintLetter
  109.      *
  110.      * @return \App\Entity\ComplaintLetter
  111.      */
  112.     public function getComplaintLetter() {
  113.         return $this->complaintLetter;
  114.     }
  115.     /**
  116.      * Set isDeleted
  117.      *
  118.      * @param boolean $isDeleted
  119.      *
  120.      * @return InsuranceDisasterDeclaration
  121.      */
  122.     public function setIsDeleted($isDeleted)
  123.     {
  124.         $this->isDeleted $isDeleted;
  125.         return $this;
  126.     }
  127.     /**
  128.      * Get isDeleted
  129.      *
  130.      * @return boolean
  131.      */
  132.     public function getIsDeleted()
  133.     {
  134.         return $this->isDeleted;
  135.     }
  136. }