src/Entity/Shoparticle.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Table(name'shoparticle')]
  7. #[ORM\Index(name'IX_articlenumber'columns: ['articlenumber'])]
  8. #[ORM\Entity(repositoryClass'App\Entity\Repository\ShoparticleRepository')]
  9. class Shoparticle
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\Column(type'integer')]
  13.     #[ORM\GeneratedValue(strategy'AUTO')]
  14.     private $id;
  15.     #[ORM\Column(type'string'nullabletrue)]
  16.     private $articlenumber;
  17.     #[ORM\Column(type'string'nullabletrue)]
  18.     private $title;
  19.     #[ORM\Column(type'string'nullabletrue)]
  20.     private $type;
  21.     #[ORM\Column(type'text'nullabletrue)]
  22.     private $description;
  23.     #[ORM\Column(type'decimal'nullabletrueprecision6scale2)]
  24.     private $price;
  25.     #[ORM\Column(type'integer'nullabletrue)]
  26.     private $stock;
  27.     #[ORM\Column(type'boolean'nullabletrue)]
  28.     private $available;
  29.     #[ORM\Column(type'string'nullabletrue)]
  30.     private $image_url;
  31.     #[ORM\Column(type'string'nullabletrue)]
  32.     private $manufacturer;
  33.     #[ORM\Column(type'integer'nullabletrue)]
  34.     private $priority;
  35.     #[ORM\Column(type'boolean'nullabletrue)]
  36.     private $is_organic;
  37.     #[ORM\Column(type'datetime'nullabletrue)]
  38.     private $date_created;
  39.     #[ORM\OneToMany(targetEntity'App\Entity\ShoparticleCrop'mappedBy'shoparticle')]
  40.     private $shoparticleCrop;
  41.     #[ORM\OneToMany(targetEntity'App\Entity\CartItem'mappedBy'shoparticle')]
  42.     private $cartItem;
  43.     #[ORM\Column(type'decimal'precision10scale2nullabletrue)]
  44.     private $cost;
  45.     #[ORM\Column(type'string'length255nullabletrue)]
  46.     private $shop_url;
  47.     #[ORM\OneToMany(mappedBy'shoparticle'targetEntityShoparticleBlockentry::class, orphanRemovaltrue)]
  48.     private Collection $shoparticleBlockentries;
  49.     public function __construct()
  50.     {
  51.         $this->shoparticleCrop = new ArrayCollection();
  52.         $this->cartItem = new ArrayCollection();
  53.         $this->shoparticleBlockentries = new ArrayCollection();
  54.     }
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     public function getArticlenumber(): ?string
  60.     {
  61.         return $this->articlenumber;
  62.     }
  63.     public function setArticlenumber(?string $articlenumber): self
  64.     {
  65.         $this->articlenumber $articlenumber;
  66.         return $this;
  67.     }
  68.     public function getTitle(): ?string
  69.     {
  70.         return $this->title;
  71.     }
  72.     public function setTitle(?string $title): self
  73.     {
  74.         $this->title $title;
  75.         return $this;
  76.     }
  77.     public function getDescription(): ?string
  78.     {
  79.         return $this->description;
  80.     }
  81.     public function setDescription(?string $description): self
  82.     {
  83.         $this->description $description;
  84.         return $this;
  85.     }
  86.     public function getPrice(): ?float
  87.     {
  88.         return $this->price;
  89.     }
  90.     public function setPrice(?float $price): self
  91.     {
  92.         $this->price $price;
  93.         return $this;
  94.     }
  95.     public function getStock(): ?int
  96.     {
  97.         return $this->stock;
  98.     }
  99.     public function setStock(?int $stock): self
  100.     {
  101.         $this->stock $stock;
  102.         return $this;
  103.     }
  104.     public function getAvailable(): ?bool
  105.     {
  106.         return $this->available;
  107.     }
  108.     public function setAvailable(?bool $available): self
  109.     {
  110.         $this->available $available;
  111.         return $this;
  112.     }
  113.     public function getImageUrl(): ?string
  114.     {
  115.         return $this->image_url;
  116.     }
  117.     public function setImageUrl(?string $image_url): self
  118.     {
  119.         $this->image_url $image_url;
  120.         return $this;
  121.     }
  122.     public function getManufacturer(): ?string
  123.     {
  124.         return $this->manufacturer;
  125.     }
  126.     public function setManufacturer(?string $manufacturer): self
  127.     {
  128.         $this->manufacturer $manufacturer;
  129.         return $this;
  130.     }
  131.     public function getDateCreated(): ?\DateTimeInterface
  132.     {
  133.         return $this->date_created;
  134.     }
  135.     public function setDateCreated(?\DateTimeInterface $date_created): self
  136.     {
  137.         $this->date_created $date_created;
  138.         return $this;
  139.     }
  140.     public function getType(): ?string
  141.     {
  142.         return $this->type;
  143.     }
  144.     public function setType(?string $type): self
  145.     {
  146.         $this->type $type;
  147.         return $this;
  148.     }
  149.     /**
  150.      * @return Collection|ShoparticleCrop[]
  151.      */
  152.     public function getShoparticleCrop(): Collection
  153.     {
  154.         return $this->shoparticleCrop;
  155.     }
  156.     public function addShoparticleCrop(ShoparticleCrop $shoparticleCrop): self
  157.     {
  158.         if (!$this->shoparticleCrop->contains($shoparticleCrop)) {
  159.             $this->shoparticleCrop[] = $shoparticleCrop;
  160.             $shoparticleCrop->setShoparticle($this);
  161.         }
  162.         return $this;
  163.     }
  164.     public function removeShoparticleCrop(ShoparticleCrop $shoparticleCrop): self
  165.     {
  166.         if ($this->shoparticleCrop->contains($shoparticleCrop)) {
  167.             $this->shoparticleCrop->removeElement($shoparticleCrop);
  168.             // set the owning side to null (unless already changed)
  169.             if ($shoparticleCrop->getShoparticle() === $this) {
  170.                 $shoparticleCrop->setShoparticle(null);
  171.             }
  172.         }
  173.         return $this;
  174.     }
  175.     public function getPriority(): ?int
  176.     {
  177.         return $this->priority;
  178.     }
  179.     public function setPriority(?int $priority): self
  180.     {
  181.         $this->priority $priority;
  182.         return $this;
  183.     }
  184.     public function getIsOrganic(): ?bool
  185.     {
  186.         return $this->is_organic;
  187.     }
  188.     public function setIsOrganic(?bool $is_organic): self
  189.     {
  190.         $this->is_organic $is_organic;
  191.         return $this;
  192.     }
  193.     /**
  194.      * @return Collection|CartItem[]
  195.      */
  196.     public function getCartItem(): Collection
  197.     {
  198.         return $this->cartItem;
  199.     }
  200.     public function addCartItem(CartItem $cartItem): self
  201.     {
  202.         if (!$this->cartItem->contains($cartItem)) {
  203.             $this->cartItem[] = $cartItem;
  204.             $cartItem->setShoparticle($this);
  205.         }
  206.         return $this;
  207.     }
  208.     public function removeCartItem(CartItem $cartItem): self
  209.     {
  210.         if ($this->cartItem->removeElement($cartItem)) {
  211.             // set the owning side to null (unless already changed)
  212.             if ($cartItem->getShoparticle() === $this) {
  213.                 $cartItem->setShoparticle(null);
  214.             }
  215.         }
  216.         return $this;
  217.     }
  218.     public function getCost(): ?string
  219.     {
  220.         return $this->cost;
  221.     }
  222.     public function setCost(?string $cost): self
  223.     {
  224.         $this->cost $cost;
  225.         return $this;
  226.     }
  227.     public function getShopUrl(): ?string
  228.     {
  229.         return $this->shop_url;
  230.     }
  231.     public function setShopUrl(?string $shop_url): self
  232.     {
  233.         $this->shop_url $shop_url;
  234.         return $this;
  235.     }
  236.     /**
  237.      * @return Collection<int, ShoparticleBlockentry>
  238.      */
  239.     public function getShoparticleBlockentries(): Collection
  240.     {
  241.         return $this->shoparticleBlockentries;
  242.     }
  243.     public function addShoparticleBlockentry(ShoparticleBlockentry $shoparticleBlockentry): static
  244.     {
  245.         if (!$this->shoparticleBlockentries->contains($shoparticleBlockentry)) {
  246.             $this->shoparticleBlockentries->add($shoparticleBlockentry);
  247.             $shoparticleBlockentry->setShoparticle($this);
  248.         }
  249.         return $this;
  250.     }
  251.     public function removeShoparticleBlockentry(ShoparticleBlockentry $shoparticleBlockentry): static
  252.     {
  253.         if ($this->shoparticleBlockentries->removeElement($shoparticleBlockentry)) {
  254.             // set the owning side to null (unless already changed)
  255.             if ($shoparticleBlockentry->getShoparticle() === $this) {
  256.                 $shoparticleBlockentry->setShoparticle(null);
  257.             }
  258.         }
  259.         return $this;
  260.     }
  261. }