src/Entity/WareHouse.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\Collection;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7.  * WareHouse
  8.  *
  9.  * @ORM\Table(name="ware_house")
  10.  * @ORM\Entity(repositoryClass="App\Repository\WareHouseRepository")
  11.  */
  12. class WareHouse //extends OrmEntity
  13. {
  14.     /**
  15.      * @var \Ramsey\Uuid\UuidInterface
  16.      *
  17.      * @ORM\Id
  18.      *  @ORM\Column(type="uuid", unique=true)
  19.      * @ORM\GeneratedValue(strategy="CUSTOM")
  20.      * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="name", type="string", length=255, nullable=false)
  27.      * @Groups("Invoice")
  28.      */
  29.     private $name;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="manager")
  32.      */
  33.     private $manager;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="manager")
  36.      */
  37.     private $user;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="App\Entity\StockTransfere", mappedBy="fromWarehouse")
  40.      */
  41.     private $inStock;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity="App\Entity\StockTransfere", mappedBy="toWarehouse")
  44.      */
  45.     private $outStock;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity="App\Entity\MovimentSupplyItem", mappedBy="warehouse")
  48.      */
  49.     private $supplysItems;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity="App\Entity\MovimentWarehouseItem", mappedBy="warehouse")
  52.      */
  53.     private $MovimentItems;
  54.     /**
  55.      * @var \DateTime
  56.      *
  57.      * @ORM\Column(name="date", type="datetime", nullable=false)
  58.      */
  59.     private $date;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity="App\Entity\Stock", mappedBy="warehouse")
  62.      */
  63.     private $stocks;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity="App\Entity\Factura", mappedBy="warehouse")
  66.      */
  67.     private $invoices;
  68.     /**
  69.      * @ORM\ManyToMany(targetEntity="App\Entity\ContaBancaria")
  70.      */
  71.     private $bankAccounts;
  72.     /**
  73.      * @ORM\ManyToOne(targetEntity="App\Entity\Address", cascade={"persist"})
  74.      */
  75.     private $address;
  76.     /**
  77.      * @var string
  78.      *
  79.      * @ORM\Column(name="code", type="string", length=255, nullable=true)
  80.      */
  81.     private $code;
  82.     
  83.     private $endereco;
  84.     /**
  85.      * @var string
  86.      *
  87.      * @ORM\Column(name="is_active", type="boolean", nullable=true)
  88.      */
  89.     private $isActive;
  90.     /**
  91.      * WareHouse constructor.
  92.      */
  93.     public function __construct()
  94.     {
  95.         $this->address = new Address();
  96.                 //parent::__construct();
  97.     }
  98.     /**
  99.      * Get id
  100.      *
  101.      * @return \Ramsey\Uuid\UuidInterface
  102.      */
  103.     public function getId()
  104.     {
  105.         return $this->id;
  106.     }
  107.     /**
  108.      * Set name
  109.      *
  110.      * @param string $name
  111.      *
  112.      * @return WareHouse
  113.      */
  114.     public function setName($name)
  115.     {
  116.         $this->name $name;
  117.         return $this;
  118.     }
  119.     /**
  120.      * Get name
  121.      *
  122.      * @return string
  123.      */
  124.     public function getName()
  125.     {
  126.         return $this->name;
  127.     }
  128.     /**
  129.      * Set endereco
  130.      *
  131.      * @param string $endereco
  132.      *
  133.      * @return WareHouse
  134.      */
  135.     public function setEndereco($endereco)
  136.     {
  137.         $this->endereco $endereco;
  138.         return $this;
  139.     }
  140.     /**
  141.      * Get endereco
  142.      *
  143.      * @return string
  144.      */
  145.     public function getEndereco()
  146.     {
  147.         return $this->endereco;
  148.     }
  149.     /**
  150.      * Set manager
  151.      *
  152.      * @param integer $manager
  153.      *
  154.      * @return WareHouse
  155.      */
  156.     public function setManager($manager)
  157.     {
  158.         $this->manager $manager;
  159.         return $this;
  160.     }
  161.     /**
  162.      * Get manager
  163.      *
  164.      * @return int
  165.      */
  166.     public function getManager()
  167.     {
  168.         return $this->manager;
  169.     }
  170.     /**
  171.      * Set date
  172.      *
  173.      * @param \DateTime $date
  174.      *
  175.      * @return WareHouse
  176.      */
  177.     public function setDate($date)
  178.     {
  179.         $this->date $date;
  180.         return $this;
  181.     }
  182.     /**
  183.      * Get date
  184.      *
  185.      * @return \DateTime
  186.      */
  187.     public function getDate()
  188.     {
  189.         return $this->date;
  190.     }
  191.     /**
  192.      * @return string
  193.      */
  194.     public function getCode()
  195.     {
  196.         return $this->code;
  197.     }
  198.     /**
  199.      * @param string $code
  200.      */
  201.     public function setCode($code)
  202.     {
  203.         $this->code $code;
  204.     }
  205.     /**
  206.      * @return Collection|Stock[]
  207.      */
  208.     public function getStocks()
  209.     {
  210.         return $this->stocks;
  211.     }
  212.     /**
  213.      * @param mixed $stocks
  214.      */
  215.     public function setStocks($stocks)
  216.     {
  217.         $this->stocks $stocks;
  218.     }
  219.     /**
  220.      * @return Collection|Factura[]
  221.      */
  222.     public function getInvoices()
  223.     {
  224.         return $this->invoices;
  225.     }
  226.     /**
  227.      * @param mixed $invoices
  228.      */
  229.     public function setInvoices($invoices)
  230.     {
  231.         $this->invoices $invoices;
  232.     }
  233.     /**
  234.      * @return Address
  235.      * @throws \Exception
  236.      */
  237.     public function getAddress()
  238.     {
  239.         return is_null($this->address) ?  new Address() : $this->address;
  240.     }
  241.     /**
  242.      * @param mixed $address
  243.      */
  244.     public function setAddress($address)
  245.     {
  246.         $this->address $address;
  247.     }
  248.     /**
  249.      * @return mixed
  250.      */
  251.     public function getUser()
  252.     {
  253.         return $this->user;
  254.     }
  255.     /**
  256.      * @param mixed $user
  257.      */
  258.     public function setUser($user)
  259.     {
  260.         $this->user $user;
  261.     }
  262.     /**
  263.      * @return mixed
  264.      */
  265.     public function getInStock()
  266.     {
  267.         return $this->inStock;
  268.     }
  269.     /**
  270.      * @param mixed $inStock
  271.      */
  272.     public function setInStock($inStock)
  273.     {
  274.         $this->inStock $inStock;
  275.     }
  276.     /**
  277.      * @return mixed
  278.      */
  279.     public function getOutStock()
  280.     {
  281.         return $this->outStock;
  282.     }
  283.     /**
  284.      * @param mixed $outStock
  285.      */
  286.     public function setOutStock($outStock)
  287.     {
  288.         $this->outStock $outStock;
  289.     }
  290.     /**
  291.      * @return string
  292.      */
  293.     public function getIsActive()
  294.     {
  295.         return $this->isActive;
  296.     }
  297.     /**
  298.      * @param string $isActive
  299.      */
  300.     public function setIsActive($isActive)
  301.     {
  302.         $this->isActive $isActive;
  303.     }
  304.     /**
  305.      * @return MovimentSupplyItem[]
  306.      */
  307.     public function getSupplysItems()
  308.     {
  309.         return $this->supplysItems;
  310.     }
  311.     /**
  312.      * @param mixed $supplysItems
  313.      */
  314.     public function setSupplysItems($supplysItems)
  315.     {
  316.         $this->supplysItems $supplysItems;
  317.     }
  318.     /**
  319.      * @return MovimentWarehouseItem[]
  320.      */
  321.     public function getMovimentItems()
  322.     {
  323.         return $this->MovimentItems;
  324.     }
  325.     /**
  326.      * @param mixed $MovimentItems
  327.      */
  328.     public function setMovimentItems($MovimentItems)
  329.     {
  330.         $this->MovimentItems $MovimentItems;
  331.     }
  332.     /**
  333.      * @return []ContaBancaria
  334.      */
  335.     public function getBankAccounts()
  336.     {
  337.         return $this->bankAccounts;
  338.     }
  339.     /**
  340.      * @param []ContaBancaria
  341.      */
  342.     public function setBankAccounts($bankAccounts)
  343.     {
  344.         $this->bankAccounts $bankAccounts;
  345.     }
  346. }