ComunidadTipo.php 2.84 KB
<?php

namespace UBV\SurUbvBundle\Entity;

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

/**
 * UBV\SurUbvBundle\Entity\ComunidadTipo
 *
 * @ORM\Entity(repositoryClass="UBV\SurUbvBundle\Entity\ComunidadTipoRepository")
 * @ORM\Table(name="comunidad_tipo", uniqueConstraints={@ORM\UniqueConstraint(name="id_comunidad_tipo_UNIQUE", columns={"id"})})
 */
class ComunidadTipo
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\SequenceGenerator(sequenceName="comunidad_tipo_id_seq", allocationSize=1, initialValue=1)
     */
    protected $id;

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

    /**
     * @ORM\OneToMany(targetEntity="Comunidad", mappedBy="comunidadTipo")
     * @ORM\JoinColumn(name="id", referencedColumnName="comunidad_tipo_id", nullable=false)
     */
    protected $comunidads;

  

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

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

        return $this;
    }

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

    /**
     * Add Comunidad entity to collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\Comunidad $comunidad
     * @return \UBV\SurUbvBundle\Entity\ComunidadTipo
     */
    public function addComunidad(Comunidad $comunidad)
    {
        $this->comunidads[] = $comunidad;

        return $this;
    }

    /**
     * Remove Comunidad entity from collection (one to many).
     *
     * @param \UBV\SurUbvBundle\Entity\Comunidad $comunidad
     * @return \UBV\SurUbvBundle\Entity\ComunidadTipo
     */
    public function removeComunidad(Comunidad $comunidad)
    {
        $this->comunidads->removeElement($comunidad);

        return $this;
    }

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

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

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

}