132 lines
2.6 KiB
PHP
132 lines
2.6 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;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->date_create = new DateTime();
|
|
$this->flag_new = 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;
|
|
}
|
|
|
|
}
|