src/Entity/Tracking.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TrackingRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTrackingRepository::class)]
  8. class Tracking
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\Column(type'datetime')]
  17.     private $modified;
  18.     #[ORM\Column(type'datetime')]
  19.     private $created;
  20.     #[ORM\OneToMany(targetEntityDistributors::class, mappedBy'tracking')]
  21.     private $distributors;
  22.     public function __construct()
  23.     {
  24.         $this->distributors = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getName(): ?string
  31.     {
  32.         return $this->name;
  33.     }
  34.     public function setName(string $name): self
  35.     {
  36.         $this->name $name;
  37.         return $this;
  38.     }
  39.     public function getModified(): ?\DateTimeInterface
  40.     {
  41.         return $this->modified;
  42.     }
  43.     public function setModified(\DateTimeInterface $modified): self
  44.     {
  45.         $this->modified $modified;
  46.         return $this;
  47.     }
  48.     public function getCreated(): ?\DateTimeInterface
  49.     {
  50.         return $this->created;
  51.     }
  52.     public function setCreated(\DateTimeInterface $created): self
  53.     {
  54.         $this->created $created;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, Distributors>
  59.      */
  60.     public function getDistributors(): Collection
  61.     {
  62.         return $this->distributors;
  63.     }
  64.     public function addDistributor(Distributors $distributor): self
  65.     {
  66.         if (!$this->distributors->contains($distributor)) {
  67.             $this->distributors[] = $distributor;
  68.             $distributor->setTracking($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeDistributor(Distributors $distributor): self
  73.     {
  74.         if ($this->distributors->removeElement($distributor)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($distributor->getTracking() === $this) {
  77.                 $distributor->setTracking(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82. }