Metodologia.php 3.61 KB
<?php

namespace UBV\SurUbvBundle\Entity;

use Doctrine\ORM\Mapping as ORM;


/**
 * UBV\SurUbvBundle\Entity\Metodologia
 *
 * @ORM\Entity(repositoryClass="UBV\SurUbvBundle\Entity\MetodologiaRepository")
 * @ORM\Table(name="metodologia", indexes={@ORM\Index(name="fk_metodologia_metodologia_tipo1_idx", columns={"metodologia_tipo_id"})}, uniqueConstraints={@ORM\UniqueConstraint(name="id_metodologia_UNIQUE", columns={"id"})})
 */
class Metodologia
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\SequenceGenerator(sequenceName="metodologia_id_seq", allocationSize=1, initialValue=1)
     */
    protected $id;

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

    /**
     * @ORM\OneToMany(targetEntity="Proyecto", mappedBy="metodologia")
     * @ORM\JoinColumn(name="id", referencedColumnName="metodologia_id", nullable=false)
     */
    protected $proyectos;

    /**
     * @ORM\ManyToOne(targetEntity="MetodologiaTipo", inversedBy="metodologias")
     * @ORM\JoinColumn(name="metodologia_tipo_id", referencedColumnName="id", nullable=false)
     */
    protected $metodologiaTipo;

    public function __construct()
    {
        
    }

    /**
     * Set the value of id.
     *
     * @param integer $id
     * @return \UBV\SurUbvBundle\Entity\Metodologia
     */
    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\Metodologia
     */
    public function setDescripcion($descripcion)
    {
        $this->descripcion = $descripcion;

        return $this;
    }

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

    /**
     * Add Proyecto entity to collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\Proyecto $proyecto
     * @return \UBV\SurUbvBundle\Entity\Metodologia
     */
    public function addProyecto(Proyecto $proyecto)
    {
        $this->proyectos[] = $proyecto;

        return $this;
    }

    /**
     * Remove Proyecto entity from collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\Proyecto $proyecto
     * @return \UBV\SurUbvBundle\Entity\Metodologia
     */
    public function removeProyecto(Proyecto $proyecto)
    {
        $this->proyectos->removeElement($proyecto);

        return $this;
    }

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

    /**
     * Set MetodologiaTipo entity (many to one).
     *
     * @param \UBV\SurUbvBundle\Entity\MetodologiaTipo $metodologiaTipo
     * @return \UBV\SurUbvBundle\Entity\Metodologia
     */
    public function setMetodologiaTipo(MetodologiaTipo $metodologiaTipo = null)
    {
        $this->metodologiaTipo = $metodologiaTipo;

        return $this;
    }

    /**
     * Get MetodologiaTipo entity (many to one).
     *
     * @return \UBV\SurUbvBundle\Entity\MetodologiaTipo
     */
    public function getMetodologiaTipo()
    {
        return $this->metodologiaTipo;
    }

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

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