src/Admin/Modules/Store/Entity/StoreProduct.php line 18
<?phpnamespace App\Admin\Modules\Store\Entity;use App\Modules\User\Entity\User;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;use Gedmo\Translatable\Translatable;/*** @ORM\Table(name="store_product", indexes={@ORM\Index(columns={"position"})})* @ORM\Entity(repositoryClass="App\Admin\Modules\Store\Repository\StoreProductRepository")* @Gedmo\TranslationEntity(class="App\Admin\Modules\Store\Entity\StoreProductTranslation")*/class StoreProduct implements Translatable{/*** @var int** @ORM\Column(type="bigint", options={"unsigned"=true}))* @ORM\Id* @ORM\GeneratedValue(strategy="AUTO")*/protected $id;/*** @var \App\Admin\Modules\Store\Entity\StoreCategory** @ORM\ManyToOne(targetEntity="App\Admin\Modules\Store\Entity\StoreCategory", inversedBy="products")* @ORM\JoinColumns({* @ORM\JoinColumn(name="id_store_category", referencedColumnName="id", nullable=false, onDelete="CASCADE")* })*/private $category;/*** @var string** @ORM\Column(name="name", type="string", length=255, nullable=false)* @Gedmo\Translatable*/private $name;/*** @var string** @ORM\Column(name="description", type="text", length=65535, nullable=false)* @Gedmo\Translatable*/private $description;/*** @var string** @ORM\Column(name="price", type="decimal", precision=14, scale=2, nullable=false)*/private $price;/*** @var int** @ORM\Column(name="vat", type="smallint", nullable=false)*/private $vat;/*** @var string** @ORM\Column(name="weight", type="string", length=25, nullable=false)*/private $weight;/*** @var int** @ORM\Column(name="lead_time", type="smallint", nullable=false)*/private $leadTime;/*** @var string** @ORM\Column(name="image", type="string", length=255, nullable=true)*/private $image;/*** @var int** @ORM\Column(name="position", type="smallint", nullable=false)*/private $position;/*** @var \App\Modules\User\Entity\User** @ORM\ManyToOne(targetEntity="App\Modules\User\Entity\User")* @ORM\JoinColumns({* @ORM\JoinColumn(name="id_added_by", referencedColumnName="id", nullable=false, onDelete="CASCADE")* })*/private $addedBy;/*** @var \App\Admin\Modules\Store\Entity\StoreProductImage** @ORM\OneToMany(targetEntity="App\Admin\Modules\Store\Entity\StoreProductImage", mappedBy="product", cascade={"persist"}, orphanRemoval=true)* @ORM\OrderBy({"id"="ASC"})*/private $images;/*** @var \App\Admin\Modules\Store\Entity\StoreProductDelivery** @ORM\OneToMany(targetEntity="App\Admin\Modules\Store\Entity\StoreProductDelivery", mappedBy="product", cascade={"persist"}, orphanRemoval=true)* @ORM\OrderBy({"price"="ASC"})*/private $deliveries;public function __construct(){$this->images = new ArrayCollection();$this->deliveries = new ArrayCollection();}public function getId(): ?string{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(string $description): self{$this->description = $description;return $this;}public function getPosition(): ?int{return $this->position;}public function setPosition(int $position): self{$this->position = $position;return $this;}public function getCategory(): ?StoreCategory{return $this->category;}public function setCategory(?StoreCategory $category): self{$this->category = $category;return $this;}public function getAddedBy(): ?User{return $this->addedBy;}public function setAddedBy(?User $addedBy): self{$this->addedBy = $addedBy;return $this;}public function getPrice(): ?string{return $this->price;}public function setPrice(string $price): self{$this->price = $price;return $this;}public function getVat(): ?int{return $this->vat;}public function setVat(int $vat): self{$this->vat = $vat;return $this;}public function getWeight(): ?string{return $this->weight;}public function setWeight(string $weight): self{$this->weight = $weight;return $this;}public function getLeadTime(): ?int{return $this->leadTime;}public function setLeadTime(int $leadTime): self{$this->leadTime = $leadTime;return $this;}public function getImage(): ?string{return $this->image;}public function setImage(?string $image): self{$this->image = $image;return $this;}/*** @return Collection<int, StoreProductImage>*/public function getImages(): Collection{return $this->images;}public function addImage(StoreProductImage $image): self{if (!$this->images->contains($image)) {$this->images->add($image);$image->setProduct($this);}return $this;}public function removeImage(StoreProductImage $image): self{if ($this->images->removeElement($image)) {// set the owning side to null (unless already changed)if ($image->getProduct() === $this) {$image->setProduct(null);}}return $this;}/*** @return Collection<int, StoreProductDelivery>*/public function getDeliveries(): Collection{return $this->deliveries;}public function addDelivery(StoreProductDelivery $delivery): self{if (!$this->deliveries->contains($delivery)) {$this->deliveries->add($delivery);$delivery->setProduct($this);}return $this;}public function removeDelivery(StoreProductDelivery $delivery): self{if ($this->deliveries->removeElement($delivery)) {// set the owning side to null (unless already changed)if ($delivery->getProduct() === $this) {$delivery->setProduct(null);}}return $this;}}