Arancel.php 4.47 KB
<?php

namespace UBV\SurUbvBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * UBV\SurUbvBundle\Entity\Arancel
 *
 * @ORM\Entity(repositoryClass="UBV\SurUbvBundle\Entity\ArancelRepository")
 * @ORM\Table(name="arancel", uniqueConstraints={@ORM\UniqueConstraint(name="id_arancel_UNIQUE", columns={"id"})})
 */
class Arancel
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="IDENTITY")
     * @ORM\SequenceGenerator(sequenceName="arancel_id_seq", allocationSize=1, initialValue=1)
     */
    protected $id;

    /**
     * @ORM\Column(type="date")
     */
    protected $fecha_inicio;

    /**
     * @ORM\Column(type="date")
     */
    protected $fecha_fin;

    /**
     * @ORM\Column(type="string", length=120)
     */
    protected $descripcion;

    /**
     * @ORM\Column(type="float")
     */
    protected $cantidad_ut;

    /**
     * @ORM\Column(type="boolean")
     */
    protected $estatus;

    /**
     * @ORM\Column(type="boolean")
     */
    protected $clase;

    /**
     * @ORM\ManyToMany(targetEntity="Deposito", mappedBy="arancels")
     */
    protected $depositos;

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

    public function __sleep()
    {
        return array('id', 'fecha_inicio', 'fecha_fin', 'descripcion', 'cantidad_ut', 'estatus', 'clase');
    }

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

    /**
     * Set fecha_inicio
     *
     * @param \DateTime $fechaInicio
     * @return Arancel
     */
    public function setFechaInicio($fechaInicio)
    {
        $this->fecha_inicio = $fechaInicio;

        return $this;
    }

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

    /**
     * Set fecha_fin
     *
     * @param \DateTime $fechaFin
     * @return Arancel
     */
    public function setFechaFin($fechaFin)
    {
        $this->fecha_fin = $fechaFin;

        return $this;
    }

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

    /**
     * Set descripcion
     *
     * @param string $descripcion
     * @return Arancel
     */
    public function setDescripcion($descripcion)
    {
        $this->descripcion = $descripcion;

        return $this;
    }

    /**
     * Get descripcion
     *
     * @return string 
     */
    public function getDescripcion()
    {
        return $this->descripcion;
    }

    /**
     * Set cantidad_ut
     *
     * @param float $cantidadUt
     * @return Arancel
     */
    public function setCantidadUt($cantidadUt)
    {
        $this->cantidad_ut = $cantidadUt;

        return $this;
    }

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

    /**
     * Set estatus
     *
     * @param boolean $estatus
     * @return Arancel
     */
    public function setEstatus($estatus)
    {
        $this->estatus = $estatus;

        return $this;
    }

    /**
     * Set clase
     *
     * @param boolean $clase
     * @return Arancel
     */
    public function setClase($clase)
    {
        $this->clase = $clase;

        return $this;
    }

    /**
     * Get clase
     *
     * @return boolean 
     */
    public function getClase()
    {
        return $this->clase;
    }

    /**
     * Get depositos
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getDepositos()
    {
        return $this->depositos;
    }
    
    public function __toString() {
      return $this->getDescripcion();
    }

    /**
     * Get estatus
     *
     * @return boolean 
     */
    public function getEstatus()
    {
        return $this->estatus;
    }

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

        return $this;
    }

    /**
     * Remove depositos
     *
     * @param \UBV\SurUbvBundle\Entity\Deposito $depositos
     */
    public function removeDeposito(\UBV\SurUbvBundle\Entity\Deposito $depositos)
    {
        $this->depositos->removeElement($depositos);
    }
}