municipio.php 2.22 KB
<?php

namespace UBV\PracticaBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * municipio
 *
 * @ORM\Table(name="municipio")
 * @ORM\Entity(repositoryClass="UBV\PracticaBundle\Repository\municipioRepository")
 */
class municipio
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="descripcion", type="string", length=255)
     */
    private $descripcion;

    /**
     * @var string
     *
     * @ORM\Column(name="codigo", type="string", length=255)
     */
    private $codigo;

    /**
     * @ORM\ManyToOne(targetEntity="estado", inversedBy="municipios", cascade={"persist", "remove"})
     * @ORM\JoinColumn(name="estado_id", referencedColumnName="id", nullable=false)
     */
    protected $estado;


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

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

        return $this;
    }

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

    /**
     * Set codigo
     *
     * @param string $codigo
     *
     * @return municipio
     */
    public function setCodigo($codigo)
    {
        $this->codigo = $codigo;

        return $this;
    }

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

    /**
     * Set estado
     *
     * @param \UBVP\racticaBundel\Entity\Estado $estado
     *
     * @return municipio
     */
    public function setEstado(\UBVP\racticaBundel\Entity\Estado $estado)
    {
        $this->estado = $estado;

        return $this;
    }

    /**
     * Get estado
     *
     * @return \UBV\SurUbvBundle\Entity\Estado 
     */
    public function getEstado()
    {
        return $this->estado;
    }
    
    public function __toString() {
      return $this->getDescripcion();
    }
}