Deposito.php 7.88 KB
<?php

namespace UBV\SurUbvBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * UBV\SurUbvBundle\Entity\Deposito
 *
 * @ORM\Entity(repositoryClass="UBV\SurUbvBundle\Entity\DepositoRepository")
 * @ORM\Table(name="deposito", indexes={@ORM\Index(name="fk_deposito_cuenta_bancaria1_idx", columns={"cuenta_bancaria_id"}), @ORM\Index(name="fk_deposito_persona1_idx", columns={"persona_id"}), @ORM\Index(name="fk_deposito_deposito_tipo1_idx", columns={"deposito_tipo_id"})}, uniqueConstraints={@ORM\UniqueConstraint(name="id_deposito_UNIQUE", columns={"id"}), @ORM\UniqueConstraint(name="num_deposito_UNIQUE", columns={"num_deposito"})})
 */
class Deposito
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="IDENTITY")
     * @ORM\SequenceGenerator(sequenceName="deposito_id_seq", allocationSize=1, initialValue=1)
     */
    protected $id;

    /**
     * @Assert\NotNull(message= "Por favor introduzca un número de deposito", groups={"Default"})
     * @Assert\NotBlank( message= "Por favor introduzca un número de deposito", groups={"Default"})
     * @ORM\Column(type="integer")
     */
    protected $num_deposito;

    /**
     * @Assert\NotNull(message= "Por favor introduzca el monto en Bs. depositado", groups={"Default"})
     * @Assert\NotBlank( message= "Por favor introduzca el monto en Bs. depositado", groups={"Default"})
     * @ORM\Column(type="float")
     */
    protected $monto;

    /**
     * @ORM\ManyToOne(targetEntity="Arancel", inversedBy="depositos")
     * @ORM\JoinColumn(name="arancel_id", referencedColumnName="id", nullable=false)
     */
    protected $arancel;
    
    /**
     * @ORM\Column(type="date")
     */
    protected $fecha_deposito;

    /**
     * @ORM\OneToMany(targetEntity="DepositoDetalle", mappedBy="deposito")
     * @ORM\JoinColumn(name="id", referencedColumnName="deposito_id", nullable=false)
     */
    protected $depositoDetalles;

    /**
     * @ORM\ManyToOne(targetEntity="CuentaBancaria", inversedBy="depositos")
     * @ORM\JoinColumn(name="cuenta_bancaria_id", referencedColumnName="id", nullable=false)
     */
    protected $cuentaBancaria;

    /**
     * @ORM\ManyToOne(targetEntity="Persona", inversedBy="depositos")
     * @ORM\JoinColumn(name="persona_id", referencedColumnName="id", nullable=false)
     */
    protected $persona;

    /**
     * @ORM\ManyToOne(targetEntity="DepositoTipo", inversedBy="depositos")
     * @ORM\JoinColumn(name="deposito_tipo_id", referencedColumnName="id", nullable=false)
     */
    protected $depositoTipo;

    /**
     * @ORM\ManyToMany(targetEntity="Arancel", inversedBy="depositos")
     * @ORM\JoinTable(name="deposito_arancel",
     *     joinColumns={@ORM\JoinColumn(name="deposito_id", referencedColumnName="id", nullable=false)},
     *     inverseJoinColumns={@ORM\JoinColumn(name="arancel_id", referencedColumnName="id", nullable=false)}
     * )
     */
    protected $arancels;

    public function __construct()
    {
        $this->depositoDetalles = new ArrayCollection();
        $this->arancels = new ArrayCollection();
    }

    public function __sleep()
    {
        return array('id', 'num_deposito', 'monto', 'cuenta_bancaria_id', 'persona_id', 'fecha_deposito', 'deposito_tipo_id');
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set num_deposito
     *
     * @param integer $numDeposito
     * @return Deposito
     */
    public function setNumDeposito($numDeposito)
    {
        $this->num_deposito = $numDeposito;

        return $this;
    }

    /**
     * Set monto
     *
     * @param float $monto
     * @return Deposito
     */
    public function setMonto($monto)
    {
        $this->monto = $monto;

        return $this;
    }

    /**
     * Get monto
     *
     * @return float 
     */
    public function getMonto()
    {
        return $this->monto;
    }

    /**
     * Set fecha_deposito
     *
     * @param \DateTime $fechaDeposito
     * @return Deposito
     */
    public function setFechaDeposito($fechaDeposito)
    {
        $this->fecha_deposito = $fechaDeposito;

        return $this;
    }

    /**
     * Get fecha_deposito
     *
     * @return \DateTime 
     */
    public function getFechaDeposito()
    {
        return $this->fecha_deposito;
    }

    /**
     * Add depositoDetalles
     *
     * @param \UBV\SurUbvBundle\Entity\DepositoDetalle $depositoDetalles
     * @return Deposito
     */
    public function addDepositoDetalle(\UBV\SurUbvBundle\Entity\DepositoDetalle $depositoDetalles)
    {
        $this->depositoDetalles[] = $depositoDetalles;

        return $this;
    }

    /**
     * Remove depositoDetalles
     *
     * @param \UBV\SurUbvBundle\Entity\DepositoDetalle $depositoDetalles
     */
    public function removeDepositoDetalle(\UBV\SurUbvBundle\Entity\DepositoDetalle $depositoDetalles)
    {
        $this->depositoDetalles->removeElement($depositoDetalles);
    }

    /**
     * Get depositoDetalles
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getDepositoDetalles()
    {
        return $this->depositoDetalles;
    }

    /**
     * Set cuentaBancaria
     *
     * @param \UBV\SurUbvBundle\Entity\CuentaBancaria $cuentaBancaria
     * @return Deposito
     */
    public function setCuentaBancaria(\UBV\SurUbvBundle\Entity\CuentaBancaria $cuentaBancaria)
    {
        $this->cuentaBancaria = $cuentaBancaria;

        return $this;
    }

    /**
     * Get cuentaBancaria
     *
     * @return \UBV\SurUbvBundle\Entity\CuentaBancaria 
     */
    public function getCuentaBancaria()
    {
        return $this->cuentaBancaria;
    }

    /**
     * Set persona
     *
     * @param \UBV\SurUbvBundle\Entity\Persona $persona
     * @return Deposito
     */
    public function setPersona(\UBV\SurUbvBundle\Entity\Persona $persona)
    {
        $this->persona = $persona;

        return $this;
    }

    /**
     * Get persona
     *
     * @return \UBV\SurUbvBundle\Entity\Persona 
     */
    public function getPersona()
    {
        return $this->persona;
    }

    /**
     * Set depositoTipo
     *
     * @param \UBV\SurUbvBundle\Entity\DepositoTipo $depositoTipo
     * @return Deposito
     */
    public function setDepositoTipo(\UBV\SurUbvBundle\Entity\DepositoTipo $depositoTipo)
    {
        $this->depositoTipo = $depositoTipo;

        return $this;
    }

    /**
     * Get depositoTipo
     *
     * @return \UBV\SurUbvBundle\Entity\DepositoTipo 
     */
    public function getDepositoTipo()
    {
        return $this->depositoTipo;
    }

    /**
     * Add arancels
     *
     * @param \UBV\SurUbvBundle\Entity\Arancel $arancels
     * @return Deposito
     */
    public function addArancel(\UBV\SurUbvBundle\Entity\Arancel $arancels)
    {
        $this->arancels[] = $arancels;

        return $this;
    }

    /**
     * Remove arancels
     *
     * @param \UBV\SurUbvBundle\Entity\Arancel $arancels
     */
    public function removeArancel(\UBV\SurUbvBundle\Entity\Arancel $arancels)
    {
        $this->arancels->removeElement($arancels);
    }

    /**
     * Get arancels
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getArancels()
    {
        return $this->arancels;
    }

    /**
     * Get num_deposito
     *
     * @return integer 
     */
    public function getNumDeposito()
    {
        return $this->num_deposito;
    }

    /**
     * Set arancel
     *
     * @param \UBV\SurUbvBundle\Entity\Arancel $arancel
     * @return Deposito
     */
    public function setArancel(\UBV\SurUbvBundle\Entity\Arancel $arancel)
    {
        $this->arancel = $arancel;

        return $this;
    }

    /**
     * Get arancel
     *
     * @return \UBV\SurUbvBundle\Entity\Arancel 
     */
    public function getArancel()
    {
        return $this->arancel;
    }

}