<?php
/**
* Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
* See https://www.x-cart.com/license-agreement.html for license details.
*/
declare(strict_types=1);
namespace XC\AutoImportBase\Model;
use Doctrine\ORM\Mapping as ORM;
use XLite\Model\Product;
/**
* @ORM\Entity
* @ORM\Table(
* name="auto_product_location_stock",
* uniqueConstraints={
* @ORM\UniqueConstraint(name="product_location_unique", columns={"product_id", "remoteLocationId", "integrationName"})
* }
* )
* @ORM\HasLifecycleCallbacks
*/
class ProductLocationStock extends \XLite\Model\AEntity
{
/**
* @ORM\Id
* @ORM\GeneratedValue (strategy="AUTO")
* @ORM\Column (options={"unsigned": true})
*/
protected ?int $id = null;
/**
* @ORM\ManyToOne (targetEntity="XLite\Model\Product", inversedBy="keystoneInventories")
* @ORM\JoinColumn (name="product_id", referencedColumnName="product_id", onDelete="CASCADE")
*/
protected ?Product $product = null;
/**
* @ORM\Column (options={ "unsigned": true })
*/
protected int $qty = 0;
/**
* @ORM\Column (type="integer", length=10, nullable=true)
*/
protected int $updatedTime;
/**
* @ORM\Column (length=32)
*/
protected string $remoteLocationId = '';
/**
* @ORM\Column (type="string")
*/
protected string $integrationName = '';
public function getRemoteLocationId(): string
{
return $this->remoteLocationId;
}
public function setRemoteLocationId(string $remoteLocationId): void
{
$this->remoteLocationId = $remoteLocationId;
}
public function getId(): ?int
{
return $this->id;
}
public function setId(int $id): void
{
$this->id = $id;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(Product $product): void
{
$this->product = $product;
}
public function getQty(): int
{
return $this->qty;
}
public function setQty(int $qty): void
{
$this->qty = $qty;
}
public function getUpdateTime(): int
{
return $this->updatedTime;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updateTime()
{
$this->updatedTime = \XLite\Core\Converter::time();
}
public function getIntegrationName(): string
{
return $this->integrationName;
}
public function setIntegrationName(string $integrationName): void
{
$this->integrationName = $integrationName;
}
}