modules/XC/AutoImportBase/src/Model/ProductLocationStock.php line 25

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
  4.  * See https://www.x-cart.com/license-agreement.html for license details.
  5.  */
  6. declare(strict_types=1);
  7. namespace XC\AutoImportBase\Model;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use XLite\Model\Product;
  10. /**
  11.  * @ORM\Entity
  12.  * @ORM\Table(
  13.  *     name="auto_product_location_stock",
  14.  *     uniqueConstraints={
  15.  *         @ORM\UniqueConstraint(name="product_location_unique", columns={"product_id", "remoteLocationId", "integrationName"})
  16.  *     }
  17.  * )
  18.  * @ORM\HasLifecycleCallbacks
  19.  */
  20. class ProductLocationStock extends \XLite\Model\AEntity
  21. {
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue (strategy="AUTO")
  25.      * @ORM\Column (options={"unsigned": true})
  26.      */
  27.     protected ?int $id null;
  28.     /**
  29.      * @ORM\ManyToOne (targetEntity="XLite\Model\Product", inversedBy="keystoneInventories")
  30.      * @ORM\JoinColumn (name="product_id", referencedColumnName="product_id", onDelete="CASCADE")
  31.      */
  32.     protected ?Product $product null;
  33.     /**
  34.      * @ORM\Column (options={ "unsigned": true })
  35.      */
  36.     protected int $qty 0;
  37.     /**
  38.      * @ORM\Column (type="integer", length=10, nullable=true)
  39.      */
  40.     protected int $updatedTime;
  41.     /**
  42.      * @ORM\Column (length=32)
  43.      */
  44.     protected string $remoteLocationId '';
  45.     /**
  46.      * @ORM\Column (type="string")
  47.      */
  48.     protected string $integrationName '';
  49.     public function getRemoteLocationId(): string
  50.     {
  51.         return $this->remoteLocationId;
  52.     }
  53.     public function setRemoteLocationId(string $remoteLocationId): void
  54.     {
  55.         $this->remoteLocationId $remoteLocationId;
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function setId(int $id): void
  62.     {
  63.         $this->id $id;
  64.     }
  65.     public function getProduct(): ?Product
  66.     {
  67.         return $this->product;
  68.     }
  69.     public function setProduct(Product $product): void
  70.     {
  71.         $this->product $product;
  72.     }
  73.     public function getQty(): int
  74.     {
  75.         return $this->qty;
  76.     }
  77.     public function setQty(int $qty): void
  78.     {
  79.         $this->qty $qty;
  80.     }
  81.     public function getUpdateTime(): int
  82.     {
  83.         return $this->updatedTime;
  84.     }
  85.     /**
  86.      * @ORM\PrePersist
  87.      * @ORM\PreUpdate
  88.      */
  89.     public function updateTime()
  90.     {
  91.         $this->updatedTime \XLite\Core\Converter::time();
  92.     }
  93.     public function getIntegrationName(): string
  94.     {
  95.         return $this->integrationName;
  96.     }
  97.     public function setIntegrationName(string $integrationName): void
  98.     {
  99.         $this->integrationName $integrationName;
  100.     }
  101. }