<?php
namespace App\Entity\System;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="ps_locks", indexes={
*
* @ORM\Index(name="reference", columns={"reference"}),
* @ORM\Index(name="date_validate", columns={"date_validate"}),
* @ORM\Index(name="ps_locks_stock_lock_reference_index", columns={"stock_lock_reference"}),
* @ORM\Index(name="date_caducity", columns={"date_caducity"}),
* @ORM\Index(name="date_add", columns={"date_add"}),
* })
*
* @ORM\Entity(repositoryClass="App\Repository\System\LockRepository")
*/
class Lock
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(name="id_lock", type="integer")
*/
private int $id;
/**
* @ORM\ManyToOne(targetEntity="Customer")
*
* @ORM\JoinColumn(name="id_customer", referencedColumnName="id_customer", nullable=false)
*/
private Customer $customer;
/**
* @ORM\ManyToOne(targetEntity="Product")
*
* @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=false)
*/
private Product $product;
/**
* @ORM\ManyToOne(targetEntity="ProductAttribute")
*
* @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute", nullable=true)
*/
private ?ProductAttribute $productAttribute;
/**
* @ORM\Column(type="integer", length=11, options={"default" : 0})
*/
private int $quantity;
/**
* @ORM\Column(type="float", options={"default" : 0.000000})
*/
private float $price;
/**
* @ORM\Column(type="datetime")
*/
private \DateTime $dateAdd;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTime $dateValidate;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTime $dateCaducity;
/**
* @ORM\Column(type="string", length=32, nullable=true)
*/
private ?string $reference;
/**
* @ORM\ManyToOne(targetEntity="LockStatus")
*
* @ORM\JoinColumn(name="id_state", referencedColumnName="id", nullable=false)
*/
private LockStatus $status;
/**
* @ORM\Column(type="string", length=64, nullable=true)
*/
private ?string $stockLockReference;
public function getId(): int
{
return $this->id;
}
public function setId(int $id): Lock
{
$this->id = $id;
return $this;
}
public function getCustomer(): Customer
{
return $this->customer;
}
public function setCustomer(Customer $customer): Lock
{
$this->customer = $customer;
return $this;
}
public function getProduct(): Product
{
return $this->product;
}
public function setProduct(Product $product): Lock
{
$this->product = $product;
return $this;
}
public function getProductAttribute(): ?ProductAttribute
{
return $this->productAttribute;
}
public function setProductAttribute(?ProductAttribute $productAttribute = null): Lock
{
$this->productAttribute = $productAttribute;
return $this;
}
public function getQuantity(): int
{
return $this->quantity;
}
public function setQuantity(int $quantity): Lock
{
$this->quantity = $quantity;
return $this;
}
public function getPrice(): float
{
return $this->price;
}
public function setPrice(float $price): Lock
{
$this->price = $price;
return $this;
}
public function getDateAdd(): \DateTime
{
return $this->dateAdd;
}
public function setDateAdd(\DateTime $dateAdd): Lock
{
$this->dateAdd = $dateAdd;
return $this;
}
public function getDateValidate(): ?\DateTime
{
return $this->dateValidate;
}
public function setDateValidate(?\DateTime $dateValidate): Lock
{
$this->dateValidate = $dateValidate;
return $this;
}
public function getDateCaducity(): ?\DateTime
{
return $this->dateCaducity;
}
public function setDateCaducity(?\DateTime $dateCaducity): Lock
{
$this->dateCaducity = $dateCaducity;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(?string $reference): Lock
{
$this->reference = $reference;
return $this;
}
/**
* @deprecated
*/
public function getStateId(): int
{
return $this->status->getId();
}
public function getStatus(): LockStatus
{
return $this->status;
}
public function setStatus(LockStatus $status): Lock
{
$this->status = $status;
return $this;
}
public function getStockLockReference(): ?string
{
return $this->stockLockReference;
}
public function setStockLockReference(?string $stockLockReference): Lock
{
$this->stockLockReference = $stockLockReference;
return $this;
}
}