src/Entity/Product.php line 25
<?php/** @author Guerby Duval <info@tranzaksyon.com>* @link https://tranzaksyon.com* @copyright You are not allowed to remove this author "Guerby Duval <info@tranzaksyon.com>", the link "https://tranzaksyon.com" neither this copyright.*/namespace App\Entity;use App\Interfaces\OwnerCompanyInterface;use App\Repository\ProductRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;use Symfony\Component\Validator\Constraints\Length;use Symfony\Component\Validator\Constraints\NotBlank;use Symfony\Component\Validator\Constraints\NotNull;use Vich\UploaderBundle\Mapping\Annotation\Uploadable;use Vich\UploaderBundle\Mapping\Annotation\UploadableField;#[ORM\Entity(repositoryClass: ProductRepository::class)]#[Uploadable]class Product implements OwnerCompanyInterface{const NORMALIZATION_CONTEXT = ['groups' =>['product_out', 'tax_out', 'product_option_out', 'stock_out', 'product_extra_option_group_out', 'product_extra_option_out']];#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['product_out', 'product_simple_out'])]private ?int $id = null;#[ORM\Column(length: 255)]#[NotBlank]#[Groups(['product_out', 'product_in', 'product_simple_out'])]private ?string $name = null;#[ORM\Column(length: 25)]#[NotBlank]#[Length(max: 25)]#[Groups(['product_out', 'product_in', 'product_simple_out'])]private ?string $sku = null;#[ORM\Column(type: Types::DECIMAL, precision: 20, scale: 6)]#[NotNull(groups: ['with-price'])]#[GreaterThanOrEqual(0.01, groups: ['with-price'])]#[Groups(['product_out', 'product_in'])]private ?string $price = null;#[ORM\ManyToOne(cascade: ['persist'])]#[Groups(['product_out', 'product_in'])]private ?Tax $tax = null;#[ORM\ManyToOne(inversedBy: 'products')]#[ORM\JoinColumn(nullable: false)]private ?SriInfo $sriInfo = null;#[ORM\Column(nullable: true)]private ?bool $noList = null;#[ORM\Column(type: Types::DECIMAL, precision: 20, scale: 3, nullable: true)]private ?string $precioCosto = null;#[ORM\Column(length: 255, nullable: true)]private ?string $externalId = null;#[ORM\Column(length: 20, nullable: true)]#[Groups(['product_out', 'product_in'])]private ?string $barCode = null;#[ORM\ManyToOne]#[ORM\JoinColumn()]private ?Invoice $invoice = null;#[ORM\Column(nullable: true)]private ?int $freeAt = null;#[ORM\Column(nullable: true, options: ['default' => true])]private ?bool $active = null;#[ORM\Column(length: 20, nullable: true)]private ?string $productType = null;#[ORM\Column(nullable: true)]private ?bool $bought = null;#[ORM\Column(nullable: true)]#[Groups(['product_out'])]private ?int $maxOption = null;#[UploadableField('uploadable', 'imagePath', 'imageSize', 'imageMime', 'imageOriginalName')]private ?File $imageFile = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['product_out'])]private ?string $imagePath = null;#[ORM\Column(length: 20, nullable: true)]private ?string $imageMime = null;#[ORM\Column(nullable: true)]private ?float $imageSize = null;#[ORM\Column(length: 255, nullable: true)]private ?string $imageOriginalName = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(length: 255, nullable: true)]private ?string $brand = null;#[ORM\Column(nullable: true)]private ?float $width = null;#[ORM\Column(nullable: true)]private ?float $height = null;#[ORM\Column(nullable: true)]private ?float $depth = null;#[ORM\Column(nullable: true)]private ?float $weight = null;public function __construct(){}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getSku(): ?string{return $this->sku;}public function setSku(string $sku): self{$this->sku = $sku;return $this;}public function getPrice(): ?string{return $this->price;}public function setPrice(string $price): self{$this->price = $price;return $this;}public function getTax(): ?Tax{return $this->tax;}public function setTax(?Tax $tax): self{$this->tax = $tax;return $this;}public function getSriInfo(): ?SriInfo{return $this->sriInfo;}public function setSriInfo(?SriInfo $sriInfo): self{$this->sriInfo = $sriInfo;return $this;}public function getPrecioCosto(): ?string{return $this->precioCosto;}public function setPrecioCosto(?string $precioCosto): self{$this->precioCosto = $precioCosto;return $this;}public function getExternalId(): ?string{return $this->externalId;}public function setExternalId(?string $externalId): self{$this->externalId = $externalId;return $this;}public function getBarCode(): ?string{return $this->barCode;}public function setBarCode(?string $barCode): self{$this->barCode = $barCode;return $this;}public function isNoList(): ?bool{return $this->noList;}public function setNoList(?bool $noList): self{$this->noList = $noList;return $this;}public function getInvoice(): ?Invoice{return $this->invoice;}public function setInvoice(?Invoice $invoice): self{$this->invoice = $invoice;return $this;}public function isActive(): ?bool{return $this->active;}public function setActive(?bool $active): static{$this->active = $active;return $this;}public function getProductType(): ?string{return $this->productType;}public function setProductType(?string $productType): static{$this->productType = $productType;return $this;}public function isBought(): ?bool{return $this->bought;}public function setBought(?bool $bought): static{$this->bought = $bought;return $this;}public function getMaxOption(): ?int{return $this->maxOption;}public function setMaxOption(?int $maxOption): static{$this->maxOption = $maxOption;return $this;}public function getImagePath(): ?string{return $this->imagePath;}public function setImagePath(?string $imagePath): static{$this->imagePath = $imagePath;return $this;}public function getImageMime(): ?string{return $this->imageMime;}public function setImageMime(?string $imageMime): static{$this->imageMime = $imageMime;return $this;}public function getImageSize(): ?float{return $this->imageSize;}public function setImageSize(?float $imageSize): static{$this->imageSize = $imageSize;return $this;}public function getImageOriginalName(): ?string{return $this->imageOriginalName;}public function setImageOriginalName(?string $imageOriginalName): static{$this->imageOriginalName = $imageOriginalName;return $this;}/*** @return File|null*/public function getImageFile(): ?File{return $this->imageFile;}/*** @param File|null $imageFile*/public function setImageFile(?File $imageFile): void{$this->imageFile = $imageFile;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): static{$this->description = $description;return $this;}public function getBrand(): ?string{return $this->brand;}public function setBrand(?string $brand): static{$this->brand = $brand;return $this;}public function getFreeAt(): ?int{return $this->freeAt;}public function setFreeAt(?int $freeAt): static{$this->freeAt = $freeAt;return $this;}public function getWidth(): ?float{return $this->width;}public function setWidth(float $width): static{$this->width = $width;return $this;}public function getHeight(): ?float{return $this->height;}public function setHeight(float $height): static{$this->height = $height;return $this;}public function getDepth(): ?float{return $this->depth;}public function setDepth(float $depth): static{$this->depth = $depth;return $this;}public function getWeight(): ?float{return $this->weight;}public function setWeight(float $weight): static{$this->weight = $weight;return $this;}}