PersonaProyecto.php 8.61 KB
<?php

namespace UBV\SurUbvBundle\Entity;

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

/**
 * UBV\SurUbvBundle\Entity\PersonaProyecto
 *
 * @ORM\Entity(repositoryClass="UBV\SurUbvBundle\Entity\PersonaProyectoRepository")
 * @ORM\Table(name="persona_proyecto", indexes={@ORM\Index(name="fk_persona_proyecto_telefono_codigo_area1_idx", columns={"telefono_codigo_area_id"})}, uniqueConstraints={@ORM\UniqueConstraint(name="id_persona_proyecto_UNIQUE", columns={"id"})})
 */
class PersonaProyecto
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\SequenceGenerator(sequenceName="persona_proyecto_id_seq", allocationSize=1, initialValue=1)
     */
    protected $id;

    /**
     * @ORM\Column(type="integer")
     */
    protected $identificacion;

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

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

    /**
     * @ORM\Column(type="string", length=50, nullable=true)
     */
    protected $correo;

    /**
     * @ORM\Column(type="integer")
     */
    protected $telefono;

    /**
     * @ORM\OneToMany(targetEntity="ProyectoComunidad", mappedBy="personaProyecto")
     * @ORM\JoinColumn(name="id", referencedColumnName="persona_proyecto_id", nullable=false)
     */
    protected $proyectoComunidads;

    /**
     * @ORM\OneToMany(targetEntity="TutorEstudios", mappedBy="personaProyecto")
     * @ORM\JoinColumn(name="id", referencedColumnName="persona_proyecto_id", nullable=false)
     */
    protected $tutorEstudios;

    /**
     * @ORM\OneToMany(targetEntity="TutorInstitucional", mappedBy="personaProyecto")
     * @ORM\JoinColumn(name="id", referencedColumnName="persona_proyecto_id", nullable=false)
     */
    protected $tutorInstitucionals;

    /**
     * @ORM\ManyToOne(targetEntity="TelefonoCodigoArea", inversedBy="personaProyectos")
     * @ORM\JoinColumn(name="telefono_codigo_area_id", referencedColumnName="id", nullable=false)
     */
    protected $telefonoCodigoArea;


     

    public function __construct()
    {
        $this->proyectoComunidads = new ArrayCollection();
        $this->tutorEstudios = new ArrayCollection();
        $this->tutorInstitucionals = new ArrayCollection();
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Add ProyectoComunidad entity to collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\ProyectoComunidad $proyectoComunidad
     * @return \UBV\SurUbvBundle\Entity\PersonaProyecto
     */
    public function addProyectoComunidad(ProyectoComunidad $proyectoComunidad)
    {
        $this->proyectoComunidads[] = $proyectoComunidad;

        return $this;
    }

    /**
     * Remove ProyectoComunidad entity from collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\ProyectoComunidad $proyectoComunidad
     * @return \UBV\SurUbvBundle\Entity\PersonaProyecto
     */
    public function removeProyectoComunidad(ProyectoComunidad $proyectoComunidad)
    {
        $this->proyectoComunidads->removeElement($proyectoComunidad);

        return $this;
    }

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

    /**
     * Add TutorEstudios entity to collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\TutorEstudios $tutorEstudios
     * @return \UBV\SurUbvBundle\Entity\PersonaProyecto
     */
    public function addTutorEstudios(TutorEstudios $tutorEstudios)
    {
        $this->tutorEstudios[] = $tutorEstudios;

        return $this;
    }

    /**
     * Remove TutorEstudios entity from collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\TutorEstudios $tutorEstudios
     * @return \UBV\SurUbvBundle\Entity\PersonaProyecto
     */
    public function removeTutorEstudios(TutorEstudios $tutorEstudios)
    {
        $this->tutorEstudios->removeElement($tutorEstudios);

        return $this;
    }

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

    /**
     * Add TutorInstitucional entity to collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\TutorInstitucional $tutorInstitucional
     * @return \UBV\SurUbvBundle\Entity\PersonaProyecto
     */
    public function addTutorInstitucional(TutorInstitucional $tutorInstitucional)
    {
        $this->tutorInstitucionals[] = $tutorInstitucional;

        return $this;
    }

    /**
     * Remove TutorInstitucional entity from collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\TutorInstitucional $tutorInstitucional
     * @return \UBV\SurUbvBundle\Entity\PersonaProyecto
     */
    public function removeTutorInstitucional(TutorInstitucional $tutorInstitucional)
    {
        $this->tutorInstitucionals->removeElement($tutorInstitucional);

        return $this;
    }

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

    /**
     * Set TelefonoCodigoArea entity (many to one).
     *
     * @param \UBV\SurUbvBundle\Entity\TelefonoCodigoArea $telefonoCodigoArea
     * @return \UBV\SurUbvBundle\Entity\PersonaProyecto
     */
    public function setTelefonoCodigoArea(TelefonoCodigoArea $telefonoCodigoArea = null)
    {
        $this->telefonoCodigoArea = $telefonoCodigoArea;

        return $this;
    }

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

    public function getVocero()
            
    {
        
        return $this->nombre . " " . $this->apellido;
    }





    public function __sleep()
    {
        return array('id', 'identificacion', 'nombre', 'apellido', 'correo', 'telefono', 'telefono_codigo_area_id');
    }

   
    
}