src/Entity/Steal.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StealRepository;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassStealRepository::class)]
  7. #[ORM\Table(name"steal")]
  8. class Steal {
  9.     #[ORM\OneToMany(targetEntityInsuranceDisasterDeclaration::class, mappedBy"steal")]
  10.     private Collection|array $insuranceDisasterDeclarations;
  11.     #[ORM\Column(type"boolean")]
  12.     private bool $isDeleted false;
  13.     #[ORM\Column(name"createdAt"type"datetime")]
  14.     private DateTime $createdAt;
  15.     #[ORM\OneToMany(targetEntityFillingComplaint::class, mappedBy"steal")]
  16.     private Collection|array $fillingComplaints;
  17.     #[ORM\OneToMany(targetEntityCharge::class, mappedBy"steal")]
  18.     private Collection|array $charges;
  19.     #[ORM\Column(name"id"type"integer")]
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue(strategy"AUTO")]
  22.     private ?int $id;
  23.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy"steals")]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private User $user;
  26.     #[ORM\ManyToMany(targetEntityItem::class, inversedBy"steals")]
  27.     private Collection|array $items;
  28.     public function __construct() {
  29.         $this->createdAt = new DateTime();
  30.     }
  31.     public function __toString() {
  32.         return "#" $this->id " - " $this->createdAt->format("d/m/Y H:i");
  33.     }
  34.     /**
  35.      * Get id
  36.      *
  37.      * @return int
  38.      */
  39.     public function getId() {
  40.         return $this->id;
  41.     }
  42.     /**
  43.      * Set createdAt
  44.      *
  45.      * @param DateTime $createdAt
  46.      *
  47.      * @return Steal
  48.      */
  49.     public function setCreatedAt($createdAt) {
  50.         $this->createdAt $createdAt;
  51.         return $this;
  52.     }
  53.     /**
  54.      * Get createdAt
  55.      *
  56.      * @return DateTime
  57.      */
  58.     public function getCreatedAt() {
  59.         return $this->createdAt;
  60.     }
  61.     /**
  62.      * Set user
  63.      *
  64.      * @param \App\Entity\User $user
  65.      *
  66.      * @return Steal
  67.      */
  68.     public function setUser(\App\Entity\User $user) {
  69.         $this->user $user;
  70.         return $this;
  71.     }
  72.     /**
  73.      * Get user
  74.      *
  75.      * @return \App\Entity\User
  76.      */
  77.     public function getUser() {
  78.         return $this->user;
  79.     }
  80.     /**
  81.      * Add item
  82.      *
  83.      * @param \App\Entity\Item $item
  84.      *
  85.      * @return Steal
  86.      */
  87.     public function addItem(\App\Entity\Item $item) {
  88.         $this->items[] = $item;
  89.         return $this;
  90.     }
  91.     /**
  92.      * Remove item
  93.      *
  94.      * @param \App\Entity\Item $item
  95.      */
  96.     public function removeItem(\App\Entity\Item $item) {
  97.         $this->items->removeElement($item);
  98.     }
  99.     /**
  100.      * Get items
  101.      *
  102.      * @return \Doctrine\Common\Collections\Collection
  103.      */
  104.     public function getItems() {
  105.         return $this->items;
  106.     }
  107.     /**
  108.      * Add insuranceDisasterDeclaration
  109.      *
  110.      * @param \App\Entity\InsuranceDisasterDeclaration $insuranceDisasterDeclaration
  111.      *
  112.      * @return Steal
  113.      */
  114.     public function addInsuranceDisasterDeclaration(\App\Entity\InsuranceDisasterDeclaration $insuranceDisasterDeclaration) {
  115.         $this->insuranceDisasterDeclarations[] = $insuranceDisasterDeclaration;
  116.         return $this;
  117.     }
  118.     /**
  119.      * Remove insuranceDisasterDeclaration
  120.      *
  121.      * @param \App\Entity\InsuranceDisasterDeclaration $insuranceDisasterDeclaration
  122.      */
  123.     public function removeInsuranceDisasterDeclaration(\App\Entity\InsuranceDisasterDeclaration $insuranceDisasterDeclaration) {
  124.         $this->insuranceDisasterDeclarations->removeElement($insuranceDisasterDeclaration);
  125.     }
  126.     /**
  127.      * Get insuranceDisasterDeclarations
  128.      *
  129.      * @return \Doctrine\Common\Collections\Collection
  130.      */
  131.     public function getInsuranceDisasterDeclarations() {
  132.         return $this->insuranceDisasterDeclarations;
  133.     }
  134.     /**
  135.      * Add fillingComplaint
  136.      *
  137.      * @param \App\Entity\FillingComplaint $fillingComplaint
  138.      *
  139.      * @return Steal
  140.      */
  141.     public function addFillingComplaint(\App\Entity\FillingComplaint $fillingComplaint) {
  142.         $this->fillingComplaints[] = $fillingComplaint;
  143.         return $this;
  144.     }
  145.     /**
  146.      * Remove fillingComplaint
  147.      *
  148.      * @param \App\Entity\FillingComplaint $fillingComplaint
  149.      */
  150.     public function removeFillingComplaint(\App\Entity\FillingComplaint $fillingComplaint) {
  151.         $this->fillingComplaints->removeElement($fillingComplaint);
  152.     }
  153.     /**
  154.      * Get fillingComplaints
  155.      *
  156.      * @return \Doctrine\Common\Collections\Collection
  157.      */
  158.     public function getFillingComplaints() {
  159.         return $this->fillingComplaints;
  160.     }
  161.     /**
  162.      * Add charge
  163.      *
  164.      * @param \App\Entity\Charge $charge
  165.      *
  166.      * @return Steal
  167.      */
  168.     public function addCharge(\App\Entity\Charge $charge) {
  169.         $this->charges[] = $charge;
  170.         return $this;
  171.     }
  172.     /**
  173.      * Remove charge
  174.      *
  175.      * @param \App\Entity\Charge $charge
  176.      */
  177.     public function removeCharge(\App\Entity\Charge $charge) {
  178.         $this->charges->removeElement($charge);
  179.     }
  180.     /**
  181.      * Get charges
  182.      *
  183.      * @return \Doctrine\Common\Collections\Collection
  184.      */
  185.     public function getCharges() {
  186.         return $this->charges;
  187.     }
  188.     /**
  189.      * Set isDeleted
  190.      *
  191.      * @param boolean $isDeleted
  192.      *
  193.      * @return Steal
  194.      */
  195.     public function setIsDeleted($isDeleted)
  196.     {
  197.         $this->isDeleted $isDeleted;
  198.         return $this;
  199.     }
  200.     /**
  201.      * Get isDeleted
  202.      *
  203.      * @return boolean
  204.      */
  205.     public function getIsDeleted()
  206.     {
  207.         return $this->isDeleted;
  208.     }
  209. }