<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* WareHouse
*
* @ORM\Table(name="ware_house")
* @ORM\Entity(repositoryClass="App\Repository\WareHouseRepository")
*/
class WareHouse //extends OrmEntity
{
/**
* @var \Ramsey\Uuid\UuidInterface
*
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
* @Groups("Invoice")
*/
private $name;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="manager")
*/
private $manager;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="manager")
*/
private $user;
/**
* @ORM\OneToMany(targetEntity="App\Entity\StockTransfere", mappedBy="fromWarehouse")
*/
private $inStock;
/**
* @ORM\OneToMany(targetEntity="App\Entity\StockTransfere", mappedBy="toWarehouse")
*/
private $outStock;
/**
* @ORM\OneToMany(targetEntity="App\Entity\MovimentSupplyItem", mappedBy="warehouse")
*/
private $supplysItems;
/**
* @ORM\OneToMany(targetEntity="App\Entity\MovimentWarehouseItem", mappedBy="warehouse")
*/
private $MovimentItems;
/**
* @var \DateTime
*
* @ORM\Column(name="date", type="datetime", nullable=false)
*/
private $date;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Stock", mappedBy="warehouse")
*/
private $stocks;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Factura", mappedBy="warehouse")
*/
private $invoices;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\ContaBancaria")
*/
private $bankAccounts;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Address", cascade={"persist"})
*/
private $address;
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=255, nullable=true)
*/
private $code;
private $endereco;
/**
* @var string
*
* @ORM\Column(name="is_active", type="boolean", nullable=true)
*/
private $isActive;
/**
* WareHouse constructor.
*/
public function __construct()
{
$this->address = new Address();
//parent::__construct();
}
/**
* Get id
*
* @return \Ramsey\Uuid\UuidInterface
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
*
* @return WareHouse
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set endereco
*
* @param string $endereco
*
* @return WareHouse
*/
public function setEndereco($endereco)
{
$this->endereco = $endereco;
return $this;
}
/**
* Get endereco
*
* @return string
*/
public function getEndereco()
{
return $this->endereco;
}
/**
* Set manager
*
* @param integer $manager
*
* @return WareHouse
*/
public function setManager($manager)
{
$this->manager = $manager;
return $this;
}
/**
* Get manager
*
* @return int
*/
public function getManager()
{
return $this->manager;
}
/**
* Set date
*
* @param \DateTime $date
*
* @return WareHouse
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* Get date
*
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}
/**
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* @param string $code
*/
public function setCode($code)
{
$this->code = $code;
}
/**
* @return Collection|Stock[]
*/
public function getStocks()
{
return $this->stocks;
}
/**
* @param mixed $stocks
*/
public function setStocks($stocks)
{
$this->stocks = $stocks;
}
/**
* @return Collection|Factura[]
*/
public function getInvoices()
{
return $this->invoices;
}
/**
* @param mixed $invoices
*/
public function setInvoices($invoices)
{
$this->invoices = $invoices;
}
/**
* @return Address
* @throws \Exception
*/
public function getAddress()
{
return is_null($this->address) ? new Address() : $this->address;
}
/**
* @param mixed $address
*/
public function setAddress($address)
{
$this->address = $address;
}
/**
* @return mixed
*/
public function getUser()
{
return $this->user;
}
/**
* @param mixed $user
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* @return mixed
*/
public function getInStock()
{
return $this->inStock;
}
/**
* @param mixed $inStock
*/
public function setInStock($inStock)
{
$this->inStock = $inStock;
}
/**
* @return mixed
*/
public function getOutStock()
{
return $this->outStock;
}
/**
* @param mixed $outStock
*/
public function setOutStock($outStock)
{
$this->outStock = $outStock;
}
/**
* @return string
*/
public function getIsActive()
{
return $this->isActive;
}
/**
* @param string $isActive
*/
public function setIsActive($isActive)
{
$this->isActive = $isActive;
}
/**
* @return MovimentSupplyItem[]
*/
public function getSupplysItems()
{
return $this->supplysItems;
}
/**
* @param mixed $supplysItems
*/
public function setSupplysItems($supplysItems)
{
$this->supplysItems = $supplysItems;
}
/**
* @return MovimentWarehouseItem[]
*/
public function getMovimentItems()
{
return $this->MovimentItems;
}
/**
* @param mixed $MovimentItems
*/
public function setMovimentItems($MovimentItems)
{
$this->MovimentItems = $MovimentItems;
}
/**
* @return []ContaBancaria
*/
public function getBankAccounts()
{
return $this->bankAccounts;
}
/**
* @param []ContaBancaria
*/
public function setBankAccounts($bankAccounts)
{
$this->bankAccounts = $bankAccounts;
}
}