src/Entity/FamilyEscandallo.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FamilyEscandalloRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FamilyEscandalloRepository::class)
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class FamilyEscandallo
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\OneToMany(targetEntity=Escandallo::class, mappedBy="familyEscandallo")
  25.      */
  26.     private $escandallo;
  27.     /**
  28.      * @ORM\Column(type="datetime_immutable")
  29.      */
  30.     private $createdAt;
  31.     /**
  32.      * @ORM\Column(type="datetime_immutable")
  33.      */
  34.     private $updatedAt;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=User::class)
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $createdId;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity=User::class)
  42.      * @ORM\JoinColumn(nullable=false)
  43.      */
  44.     private $updatedId;
  45.     public function __construct()
  46.     {
  47.         $this->escandallo = new ArrayCollection();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getName(): ?string
  54.     {
  55.         return $this->name;
  56.     }
  57.     public function setName(string $name): self
  58.     {
  59.         $this->name $name;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return Collection<int, Escandallo>
  64.      */
  65.     public function getEscandallo(): Collection
  66.     {
  67.         return $this->escandallo;
  68.     }
  69.     public function addEscandallo(Escandallo $escandallo): self
  70.     {
  71.         if (!$this->escandallo->contains($escandallo)) {
  72.             $this->escandallo[] = $escandallo;
  73.             $escandallo->setFamilyEscandallo($this);
  74.         }
  75.         return $this;
  76.     }
  77.     public function removeEscandallo(Escandallo $escandallo): self
  78.     {
  79.         if ($this->escandallo->removeElement($escandallo)) {
  80.             // set the owning side to null (unless already changed)
  81.             if ($escandallo->getFamilyEscandallo() === $this) {
  82.                 $escandallo->setFamilyEscandallo(null);
  83.             }
  84.         }
  85.         return $this;
  86.     }
  87.     public function getCreatedAt(): ?\DateTimeImmutable
  88.     {
  89.         return $this->createdAt;
  90.     }
  91.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  92.     {
  93.         $this->createdAt $createdAt;
  94.         return $this;
  95.     }
  96.     public function getUpdatedAt(): ?\DateTimeImmutable
  97.     {
  98.         return $this->updatedAt;
  99.     }
  100.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  101.     {
  102.         $this->updatedAt $updatedAt;
  103.         return $this;
  104.     }
  105.     /**
  106.      * @ORM\PrePersist
  107.      */
  108.     public function setCreatedAtValue()
  109.     {
  110.         $this->createdAt = new \DateTimeImmutable();
  111.     }
  112.     /**
  113.      * @ORM\PrePersist
  114.      * @ORM\PreUpdate
  115.      */
  116.     public function setUpdatedAtValue()
  117.     {
  118.         $this->updatedAt = new \DateTimeImmutable();
  119.     }
  120.     public function getCreatedId(): ?User
  121.     {
  122.         return $this->createdId;
  123.     }
  124.     public function setCreatedId(?User $createdId): self
  125.     {
  126.         $this->createdId $createdId;
  127.         return $this;
  128.     }
  129.     public function getUpdatedId(): ?User
  130.     {
  131.         return $this->updatedId;
  132.     }
  133.     public function setUpdatedId(?User $updatedId): self
  134.     {
  135.         $this->updatedId $updatedId;
  136.         return $this;
  137.     }
  138. }