src/Entity/Card.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\MDS\EventsBundle\Entity\ProposalDocument;
  4. use App\Repository\CardRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. /**
  10.  * @ORM\Entity(repositoryClass=CardRepository::class)
  11.  */
  12. class Card
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      * 
  19.      * @Groups({"card:read"})
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      * 
  25.      * @Groups({"card:read"})
  26.      */
  27.     private $name;
  28.     /**
  29.      * @ORM\Column(type="integer", nullable=true)
  30.      * 
  31.      * @Groups({"card:read"})
  32.      */
  33.     private $number;
  34.     /**
  35.      * @ORM\Column(type="integer")
  36.      * 
  37.      * @Groups({"card:read"})
  38.      */
  39.     private $status;
  40.     /**
  41.      * @ORM\Column(type="datetime_immutable")
  42.      */
  43.     private $createdAt;
  44.     /**
  45.      * @ORM\ManyToOne(targetEntity=User::class)
  46.      * @ORM\JoinColumn(nullable=false)
  47.      */
  48.     private $createdId;
  49.     /**
  50.      * @ORM\Column(type="datetime_immutable")
  51.      */
  52.     private $updatedAt;
  53.     /**
  54.      * @ORM\ManyToOne(targetEntity=User::class)
  55.      * @ORM\JoinColumn(nullable=false)
  56.      */
  57.     private $updatedId;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity=ProposalDocument::class, mappedBy="card")
  60.      */
  61.     private $proposalDocuments;
  62.     public function __construct()
  63.     {
  64.         $this->proposalDocuments = new ArrayCollection();
  65.     }
  66.     public function getId(): ?int
  67.     {
  68.         return $this->id;
  69.     }
  70.     public function getName(): ?string
  71.     {
  72.         return $this->name;
  73.     }
  74.     public function setName(string $name): self
  75.     {
  76.         $this->name $name;
  77.         return $this;
  78.     }
  79.     public function getNumber(): ?int
  80.     {
  81.         return $this->number;
  82.     }
  83.     public function setNumber(?int $number): self
  84.     {
  85.         $this->number $number;
  86.         return $this;
  87.     }
  88.     public function getStatus(): ?int
  89.     {
  90.         return $this->status;
  91.     }
  92.     public function setStatus(int $status): self
  93.     {
  94.         $this->status $status;
  95.         return $this;
  96.     }
  97.     public function getCreatedAt(): ?\DateTimeImmutable
  98.     {
  99.         return $this->createdAt;
  100.     }
  101.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  102.     {
  103.         $this->createdAt $createdAt;
  104.         return $this;
  105.     }
  106.     public function getCreatedId(): ?int
  107.     {
  108.         return $this->createdId;
  109.     }
  110.     public function setCreatedId(int $createdId): self
  111.     {
  112.         $this->createdId $createdId;
  113.         return $this;
  114.     }
  115.     public function getUpdatedAt(): ?\DateTimeImmutable
  116.     {
  117.         return $this->updatedAt;
  118.     }
  119.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  120.     {
  121.         $this->updatedAt $updatedAt;
  122.         return $this;
  123.     }
  124.     public function getUpdatedId(): ?User
  125.     {
  126.         return $this->updatedId;
  127.     }
  128.     public function setUpdatedId(?User $updatedId): self
  129.     {
  130.         $this->updatedId $updatedId;
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection<int, ProposalDocument>
  135.      */
  136.     public function getProposalDocuments(): Collection
  137.     {
  138.         return $this->proposalDocuments;
  139.     }
  140.     public function addProposalDocument(ProposalDocument $proposalDocument): self
  141.     {
  142.         if (!$this->proposalDocuments->contains($proposalDocument)) {
  143.             $this->proposalDocuments[] = $proposalDocument;
  144.             $proposalDocument->setCard($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeProposalDocument(ProposalDocument $proposalDocument): self
  149.     {
  150.         if ($this->proposalDocuments->removeElement($proposalDocument)) {
  151.             // set the owning side to null (unless already changed)
  152.             if ($proposalDocument->getCard() === $this) {
  153.                 $proposalDocument->setCard(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158. }