Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace PrestamoBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
- /**
- * Persona
- *
- * @ORM\Table()
- * @ORM\Entity(repositoryClass="PrestamoBundle\Entity\PersonaRepository")
- * @UniqueEntity(
- * fields={"iden"},
- * message="¡El usuario ya se encuentra registrado!"
- * )
- */
- class Persona
- {
- public function __toString()
- {
- return $this->getPnom();
- }
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="iden", type="string", length=50, unique=true)
- */
- private $iden;
- /**
- * @var string
- *
- * @ORM\Column(name="pnom", type="string", length=50)
- * @Assert\Type(
- * type="string",
- * message="El tipo de dato introducido no es válido"
- * )
- */
- private $pnom;
- /**
- * @var string
- *
- * @ORM\Column(name="snom", type="string", length=50, nullable=true)
- * @Assert\Type(
- * type="string",
- * message="El tipo de dato introducido no es válido"
- * )
- */
- private $snom;
- /**
- * @var string
- *
- * @ORM\Column(name="ape", type="string", length=100)
- * @Assert\Type(
- * type="string",
- * message="El tipo de dato introducido no es válido"
- * )
- */
- private $ape;
- /**
- * @var string
- *
- * @ORM\Column(name="gen", type="string", length=255)
- */
- private $gen;
- /**
- * @var string
- *
- * @ORM\Column(name="tel1", type="integer")
- * @Assert\Type(
- * type="integer",
- * message="El tipo de dato introducido no es válido"
- * )
- */
- private $tel1;
- /**
- * @var string
- *
- * @ORM\Column(name="tel2", type="integer", nullable=true)
- * @Assert\Type(
- * type="integer",
- * message="El tipo de dato introducido no es válido"
- * )
- */
- private $tel2;
- /**
- * @var string
- *
- * @ORM\Column(name="dir", type="string", length=255, nullable=true)
- */
- private $dir;
- /**
- * @var string
- *
- * @ORM\Column(name="prog", type="string", length=255, nullable=true)
- */
- private $prog;
- /**
- * @var string
- *
- * @ORM\Column(name="sem", type="integer", nullable=true)
- */
- private $sem;
- /**
- * PRESTAMOS
- * @ORM\OneToMany(targetEntity="Prestamo", mappedBy="persona", cascade={"persist", "remove"})
- */
- private $prestamos;
- /**
- * GRUPOS
- * @ORM\OneToMany(targetEntity="SeguridadBundle\Entity\Usergroup", mappedBy="persona", cascade={"persist", "remove"})
- */
- private $grupos;
- //DEPENDENCIAS
- /**
- * @ORM\OneToOne(targetEntity="DeteccionBundle\Entity\Seccion", mappedBy="encargado")
- */
- private $seccion;
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->prestamos = new \Doctrine\Common\Collections\ArrayCollection();
- $this->grupos = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set iden
- *
- * @param string $iden
- *
- * @return Persona
- */
- public function setIden($iden)
- {
- $this->iden = $iden;
- return $this;
- }
- /**
- * Get iden
- *
- * @return string
- */
- public function getIden()
- {
- return $this->iden;
- }
- /**
- * Set pnom
- *
- * @param string $pnom
- *
- * @return Persona
- */
- public function setPnom($pnom)
- {
- $this->pnom = $pnom;
- return $this;
- }
- /**
- * Get pnom
- *
- * @return string
- */
- public function getPnom()
- {
- return $this->pnom;
- }
- /**
- * Set snom
- *
- * @param string $snom
- *
- * @return Persona
- */
- public function setSnom($snom)
- {
- $this->snom = $snom;
- return $this;
- }
- /**
- * Get snom
- *
- * @return string
- */
- public function getSnom()
- {
- return $this->snom;
- }
- /**
- * Set ape
- *
- * @param string $ape
- *
- * @return Persona
- */
- public function setApe($ape)
- {
- $this->ape = $ape;
- return $this;
- }
- /**
- * Get ape
- *
- * @return string
- */
- public function getApe()
- {
- return $this->ape;
- }
- /**
- * Set gen
- *
- * @param string $gen
- *
- * @return Persona
- */
- public function setGen($gen)
- {
- $this->gen = $gen;
- return $this;
- }
- /**
- * Get gen
- *
- * @return string
- */
- public function getGen()
- {
- return $this->gen;
- }
- /**
- * Set tel1
- *
- * @param integer $tel1
- *
- * @return Persona
- */
- public function setTel1($tel1)
- {
- $this->tel1 = $tel1;
- return $this;
- }
- /**
- * Get tel1
- *
- * @return integer
- */
- public function getTel1()
- {
- return $this->tel1;
- }
- /**
- * Set tel2
- *
- * @param integer $tel2
- *
- * @return Persona
- */
- public function setTel2($tel2)
- {
- $this->tel2 = $tel2;
- return $this;
- }
- /**
- * Get tel2
- *
- * @return integer
- */
- public function getTel2()
- {
- return $this->tel2;
- }
- /**
- * Set dir
- *
- * @param string $dir
- *
- * @return Persona
- */
- public function setDir($dir)
- {
- $this->dir = $dir;
- return $this;
- }
- /**
- * Get dir
- *
- * @return string
- */
- public function getDir()
- {
- return $this->dir;
- }
- /**
- * Set prog
- *
- * @param string $prog
- *
- * @return Persona
- */
- public function setProg($prog)
- {
- $this->prog = $prog;
- return $this;
- }
- /**
- * Get prog
- *
- * @return string
- */
- public function getProg()
- {
- return $this->prog;
- }
- /**
- * Set sem
- *
- * @param integer $sem
- *
- * @return Persona
- */
- public function setSem($sem)
- {
- $this->sem = $sem;
- return $this;
- }
- /**
- * Get sem
- *
- * @return integer
- */
- public function getSem()
- {
- return $this->sem;
- }
- /**
- * Add prestamo
- *
- * @param \PrestamoBundle\Entity\Prestamo $prestamo
- *
- * @return Persona
- */
- public function addPrestamo(\PrestamoBundle\Entity\Prestamo $prestamo)
- {
- $this->prestamos[] = $prestamo;
- return $this;
- }
- /**
- * Remove prestamo
- *
- * @param \PrestamoBundle\Entity\Prestamo $prestamo
- */
- public function removePrestamo(\PrestamoBundle\Entity\Prestamo $prestamo)
- {
- $this->prestamos->removeElement($prestamo);
- }
- /**
- * Get prestamos
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getPrestamos()
- {
- return $this->prestamos;
- }
- /**
- * Add grupo
- *
- * @param \SeguridadBundle\Entity\Usergroup $grupo
- *
- * @return Persona
- */
- public function addGrupo(\SeguridadBundle\Entity\Usergroup $grupo)
- {
- $this->grupos[] = $grupo;
- return $this;
- }
- /**
- * Remove grupo
- *
- * @param \SeguridadBundle\Entity\Usergroup $grupo
- */
- public function removeGrupo(\SeguridadBundle\Entity\Usergroup $grupo)
- {
- $this->grupos->removeElement($grupo);
- }
- /**
- * Get grupos
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getGrupos()
- {
- return $this->grupos;
- }
- /**
- * Set seccion
- *
- * @param \DeteccionBundle\Entity\Seccion $seccion
- *
- * @return Persona
- */
- public function setSeccion(\DeteccionBundle\Entity\Seccion $seccion = null)
- {
- $this->seccion = $seccion;
- return $this;
- }
- /**
- * Get seccion
- *
- * @return \DeteccionBundle\Entity\Seccion
- */
- public function getSeccion()
- {
- return $this->seccion;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement