src/Entity/Product/ProductVariant.php line 15

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Product;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Sylius\Component\Core\Model\ProductVariant as BaseProductVariant;
  6. use Sylius\Component\Product\Model\ProductVariantTranslationInterface;
  7. /**
  8.  * @ORM\Entity
  9.  * @ORM\Table(name="sylius_product_variant")
  10.  */
  11. class ProductVariant extends BaseProductVariant
  12. {
  13.     /**
  14.      * @ORM\Column(name="internal_id", type="string", length=50, nullable=true)
  15.      */
  16.     private ?string $internalId;
  17.     /**
  18.      * @ORM\Column(name="purchase_price", type="integer", nullable=true)
  19.      */
  20.     private ?int $purchasePrice null;
  21.     /**
  22.      * @return string
  23.      */
  24.     public function getInternalId(): ?string
  25.     {
  26.         return $this->internalId;
  27.     }
  28.     /**
  29.      * @param null|string $internalId
  30.      */
  31.     public function setInternalId(?string $internalId): void
  32.     {
  33.         $this->internalId $internalId;
  34.     }
  35.     protected function createTranslation(): ProductVariantTranslationInterface
  36.     {
  37.         return new ProductVariantTranslation();
  38.     }
  39.     public function getDescription(): ?string
  40.     {
  41.         return $this->getTranslation()->getDescription();
  42.     }
  43.     public function getPurchasePrice(): ?int
  44.     {
  45.         return $this->purchasePrice;
  46.     }
  47.     public function setPurchasePrice(?int $purchasePrice): void
  48.     {
  49.         $this->purchasePrice $purchasePrice;
  50.     }
  51. }