Import angepasst
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
dotworker
2023-02-24 09:17:56 +01:00
parent f0aa2ac5d5
commit 101f3652c5
10 changed files with 238 additions and 119 deletions

View File

@@ -21,12 +21,14 @@ class Product
#[ORM\Column(length: 255)]
private ?string $shopwareId = null;
#[ORM\Column(length: 255)]
private ?string $modellnr = null;
#[ORM\Column(length: 255)]
private ?string $modellbez = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $updateTime = null;
#[ORM\OneToOne(inversedBy: 'product', cascade: ['persist', 'remove'])]
private ?Stock $stock = null;
public function getId(): ?int
{
@@ -44,6 +46,28 @@ class Product
return $this;
}
public function getModellNr(): ?string
{
return $this->modellnr;
}
public function setModellNr(string $modellnr): self
{
$this->modellnr = $modellnr;
return $this;
}
public function getModellBez(): ?string
{
return $this->modellbez;
}
public function setModellBez(string $modellbez): self
{
$this->modellbez = $modellbez;
return $this;
}
public function getShopwareId(): ?string
{
@@ -69,15 +93,4 @@ class Product
return $this;
}
public function getStock(): ?Stock
{
return $this->stock;
}
public function setStock(?Stock $stock): self
{
$this->stock = $stock;
return $this;
}
}

View File

@@ -3,9 +3,17 @@
namespace App\Entity;
use App\Repository\StockRepository;
#use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StockRepository::class)]
#[ORM\UniqueEntity(['warehouse_id', 'product_id'])]
#[ORM\UniqueConstraint(
name: 'UNIQ_D34A04ADDCD6110',
columns: ['warehouse_id', 'product_id']
)]
class Stock
{
#[ORM\Id]
@@ -15,17 +23,26 @@ class Stock
#[ORM\Column]
private ?int $instock = null;
#[ORM\OneToOne(mappedBy: 'stock', cascade: ['persist', 'remove'])]
private ?Product $product = null;
#[ORM\Column]
private ?int $product_id = null;
#[ORM\ManyToOne(inversedBy: 'stocks')]
private ?Warehouse $warehouse = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $update_time = null;
public function getId(): ?int
{
return $this->id;
}
public function setId(int $id): ?self
{
$this->id = $id;
return $this;
}
public function getInstock(): ?int
{
@@ -38,6 +55,28 @@ class Stock
return $this;
}
public function getProductId(): ?int
{
return $this->product_id;
}
public function setProductId(int $product_id): self
{
$this->product_id = $product_id;
return $this;
}
public function getWarehouseId(): ?int
{
return $this->warehouse_id;
}
public function setWarehouseId(int $warehouse_id): self
{
$this->warehouse_id = $warehouse_id;
return $this;
}
public function getProduct(): ?Product
{
@@ -72,4 +111,16 @@ class Stock
return $this;
}
public function getUpdateTime(): ?\DateTimeInterface
{
return $this->update_time;
}
public function setUpdateTime(?\DateTimeInterface $update_time): self
{
$this->update_time = $update_time;
return $this;
}
}

View File

@@ -33,6 +33,11 @@ class Warehouse
{
return $this->id;
}
public function setId(int $id): self
{
$this->id = $id;
return $this;
}
public function getName(): ?string
{