AporteTipo.php 4.34 KB
<?php

namespace UBV\SurUbvBundle\Entity;

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

/**
 * UBV\SurUbvBundle\Entity\AporteTipo
 *
 * @ORM\Entity(repositoryClass="UBV\SurUbvBundle\Entity\AporteTipoRepository")
 * @ORM\Table(name="aporte_tipo", uniqueConstraints={@ORM\UniqueConstraint(name="id_aporte_tipo_UNIQUE", columns={"id"})})
 */
class AporteTipo
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\SequenceGenerator(sequenceName="aporte_tipo_id_seq", allocationSize=1, initialValue=1)
     */
    protected $id;

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

    /**
     * @ORM\OneToMany(targetEntity="AporteInstitucion", mappedBy="aporteTipo")
     * @ORM\JoinColumn(name="id", referencedColumnName="aporte_tipo_id", nullable=false)
     */
    protected $aporteInstitucions;

    /**
     * @ORM\OneToMany(targetEntity="RequerimientoProyecto", mappedBy="aporteTipo")
     * @ORM\JoinColumn(name="id", referencedColumnName="aporte_tipo_id", nullable=false)
     */
    protected $requerimientoProyectos;


  

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

    /**
     * Set the value of id.
     *
     * @param integer $id
     * @return \UBV\SurUbvBundle\Entity\AporteTipo
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

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

    /**
     * Set the value of descripcion.
     *
     * @param string $descripcion
     * @return \UBV\SurUbvBundle\Entity\AporteTipo
     */
    public function setDescripcion($descripcion)
    {
        $this->descripcion = $descripcion;

        return $this;
    }

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

    /**
     * Add AporteInstitucion entity to collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\AporteInstitucion $aporteInstitucion
     * @return \UBV\SurUbvBundle\Entity\AporteTipo
     */
    public function addAporteInstitucion(AporteInstitucion $aporteInstitucion)
    {
        $this->aporteInstitucions[] = $aporteInstitucion;

        return $this;
    }

    /**
     * Remove AporteInstitucion entity from collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\AporteInstitucion $aporteInstitucion
     * @return \UBV\SurUbvBundle\Entity\AporteTipo
     */
    public function removeAporteInstitucion(AporteInstitucion $aporteInstitucion)
    {
        $this->aporteInstitucions->removeElement($aporteInstitucion);

        return $this;
    }

    /**
     * Get AporteInstitucion entity collection (one to many).
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAporteInstitucions()
    {
        return $this->aporteInstitucions;
    }

    /**
     * Add RequerimientoProyecto entity to collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\RequerimientoProyecto $requerimientoProyecto
     * @return \UBV\SurUbvBundle\Entity\AporteTipo
     */
    public function addRequerimientoProyecto(RequerimientoProyecto $requerimientoProyecto)
    {
        $this->requerimientoProyectos[] = $requerimientoProyecto;

        return $this;
    }

    /**
     * Remove RequerimientoProyecto entity from collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\RequerimientoProyecto $requerimientoProyecto
     * @return \UBV\SurUbvBundle\Entity\AporteTipo
     */
    public function removeRequerimientoProyecto(RequerimientoProyecto $requerimientoProyecto)
    {
        $this->requerimientoProyectos->removeElement($requerimientoProyecto);

        return $this;
    }

    /**
     * Get RequerimientoProyecto entity collection (one to many).
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getRequerimientoProyectos()
    {
        return $this->requerimientoProyectos;
    }

    public function __sleep()
    {
        return array('id', 'descripcion');
    }

    public function __toString() {
        return $this->descripcion;
    }
}