resq/src/Entity/SAPBattery.php
2021-03-18 23:13:42 +08:00

149 lines
3 KiB
PHP

<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use DateTime;
/**
* @ORM\Entity
* @ORM\Table(name="sap_battery")
*/
class SAPBattery
{
// battery sku
/**
* @ORM\Id
* @ORM\Column(type="string", length=25)
*/
protected $id;
/**
* @ORM\Column(type="datetime")
*/
protected $date_create;
/**
* @ORM\Column(type="datetime", columnDefinition="timestamp default current_timestamp on update current_timestamp")
*/
protected $date_update;
// brand
/**
* @ORM\ManyToOne(targetEntity="SAPBatteryBrand", inversedBy="batteries")
* @ORM\JoinColumn(name="brand_id", referencedColumnName="id")
*/
protected $brand;
// size
/**
* @ORM\ManyToOne(targetEntity="SAPBatterySize", inversedBy="batteries")
* @ORM\JoinColumn(name="size_id", referencedColumnName="id")
*/
protected $size;
// flag/tag to indicate this SAP battery is the latest/newest
/**
* @ORM\Column(type="boolean")
*/
protected $flag_new;
// container size
/**
* @ORM\ManyToOne(targetEntity="SAPBatteryContainerSize", inversedBy="batteries")
* @ORM\JoinColumn(name="container_size_id", referencedColumnName="id")
*/
protected $container_size;
// flag to indicate if this SAP battery is inventory or non-inventory
/**
* @ORM\Column(type="boolean")
*/
protected $flag_inventory;
public function __construct()
{
$this->date_create = new DateTime();
$this->flag_new = false;
$this->flag_inventory = false;
}
public function setID($id)
{
$this->id = $id;
return $this;
}
public function getID()
{
return $this->id;
}
public function getDateCreate()
{
return $this->date_create;
}
public function getDateUpdate()
{
return $this->date_update;
}
public function setBrand($brand)
{
$this->brand = $brand;
return $this;
}
public function getBrand()
{
return $this->brand;
}
public function setSize($size)
{
$this->size = $size;
return $this;
}
public function getSize()
{
return $this->size;
}
public function setNew($new = false)
{
$this->flag_new = $new;
return $this;
}
public function isNew()
{
return $this->flag_new;
}
public function setContainerSize($container_size)
{
$this->container_size = $container_size;
return $this;
}
public function getContainerSize()
{
return $this->container_size;
}
public function setInventory($inventory = false)
{
$this->flag_inventory = $inventory;
return $this;
}
public function isInventory()
{
return $this->flag_inventory;
}
}