src/Entity/Geraete.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\GeraeteRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=GeraeteRepository::class)
  9.  */
  10. class Geraete
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=Marke::class, inversedBy="geraetes")
  24.      */
  25.     private $marke;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Preise::class, mappedBy="Geraete", cascade={"remove"})
  28.      */
  29.     private $preises;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $bild;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $deviceType;
  38.     /**
  39.      * @ORM\Column(type="integer", nullable=true)
  40.      */
  41.     private $positionTable;
  42.     public function __construct()
  43.     {
  44.         $this->preises = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getName(): ?string
  51.     {
  52.         return $this->name;
  53.     }
  54.     public function setName(string $name): self
  55.     {
  56.         $this->name $name;
  57.         return $this;
  58.     }
  59.     public function getMarke(): ?Marke
  60.     {
  61.         return $this->marke;
  62.     }
  63.     public function setMarke(?Marke $marke): self
  64.     {
  65.         $this->marke $marke;
  66.         return $this;
  67.     }
  68.     /**
  69.      * @return Collection<int, Preise>
  70.      */
  71.     public function getPreises(): Collection
  72.     {
  73.         return $this->preises;
  74.     }
  75.     public function addPreise(Preise $preise): self
  76.     {
  77.         if (!$this->preises->contains($preise)) {
  78.             $this->preises[] = $preise;
  79.             $preise->setGeraete($this);
  80.         }
  81.         return $this;
  82.     }
  83.     public function removePreise(Preise $preise): self
  84.     {
  85.         if ($this->preises->removeElement($preise)) {
  86.             // set the owning side to null (unless already changed)
  87.             if ($preise->getGeraete() === $this) {
  88.                 $preise->setGeraete(null);
  89.             }
  90.         }
  91.         return $this;
  92.     }
  93.     public function getBild(): ?string
  94.     {
  95.         return $this->bild;
  96.     }
  97.     public function setBild(?string $bild): self
  98.     {
  99.         $this->bild $bild;
  100.         return $this;
  101.     }
  102.     public function getDeviceType(): ?string
  103.     {
  104.         return $this->deviceType;
  105.     }
  106.     public function setDeviceType(string $deviceType): self
  107.     {
  108.         $this->deviceType $deviceType;
  109.         return $this;
  110.     }
  111.     public function getPositionTable(): ?int
  112.     {
  113.         return $this->positionTable;
  114.     }
  115.     public function setPositionTable(?int $positionTable): self
  116.     {
  117.         $this->positionTable $positionTable;
  118.         return $this;
  119.     }
  120. }