Advertisement
Guest User

Persona

a guest
Aug 15th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.74 KB | None | 0 0
  1. <?php
  2.  
  3. namespace PrestamoBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7.  
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9.  
  10. /**
  11.  * Persona
  12.  *
  13.  * @ORM\Table()
  14.  * @ORM\Entity(repositoryClass="PrestamoBundle\Entity\PersonaRepository")
  15.  * @UniqueEntity(
  16.  *     fields={"iden"},
  17.  *     message="¡El usuario ya se encuentra registrado!"
  18.  *     )
  19.  */
  20. class Persona
  21. {
  22.  
  23.     public function __toString()
  24.     {
  25.         return $this->getPnom();
  26.     }
  27.     /**
  28.      * @var integer
  29.      *
  30.      * @ORM\Column(name="id", type="integer")
  31.      * @ORM\Id
  32.      * @ORM\GeneratedValue(strategy="AUTO")
  33.      */
  34.     private $id;
  35.  
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="iden", type="string", length=50, unique=true)
  40.      */
  41.     private $iden;
  42.  
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(name="pnom", type="string", length=50)
  47.      * @Assert\Type(
  48.      *     type="string",
  49.      *     message="El tipo de dato introducido no es válido"
  50.      * )
  51.      */
  52.     private $pnom;
  53.  
  54.     /**
  55.      * @var string
  56.      *
  57.      * @ORM\Column(name="snom", type="string", length=50, nullable=true)
  58.      * @Assert\Type(
  59.      *     type="string",
  60.      *     message="El tipo de dato introducido no es válido"
  61.      * )
  62.      */
  63.     private $snom;
  64.  
  65.     /**
  66.      * @var string
  67.      *
  68.      * @ORM\Column(name="ape", type="string", length=100)
  69.      * @Assert\Type(
  70.      *     type="string",
  71.      *     message="El tipo de dato introducido no es válido"
  72.      * )
  73.      */
  74.     private $ape;
  75.  
  76.     /**
  77.      * @var string
  78.      *
  79.      * @ORM\Column(name="gen", type="string", length=255)
  80.      */
  81.     private $gen;
  82.  
  83.     /**
  84.      * @var string
  85.      *
  86.      * @ORM\Column(name="tel1", type="integer")
  87.      * @Assert\Type(
  88.      *     type="integer",
  89.      *     message="El tipo de dato introducido no es válido"
  90.      * )
  91.      */
  92.     private $tel1;
  93.  
  94.     /**
  95.      * @var string
  96.      *
  97.      * @ORM\Column(name="tel2", type="integer", nullable=true)
  98.      * @Assert\Type(
  99.      *     type="integer",
  100.      *     message="El tipo de dato introducido no es válido"
  101.      * )
  102.      */
  103.     private $tel2;
  104.  
  105.     /**
  106.      * @var string
  107.      *
  108.      * @ORM\Column(name="dir", type="string", length=255, nullable=true)
  109.      */
  110.     private $dir;
  111.  
  112.     /**
  113.      * @var string
  114.      *
  115.      * @ORM\Column(name="prog", type="string", length=255, nullable=true)
  116.      */
  117.     private $prog;
  118.  
  119.     /**
  120.      * @var string
  121.      *
  122.      * @ORM\Column(name="sem", type="integer", nullable=true)
  123.      */
  124.     private $sem;
  125.  
  126.  
  127.  
  128.     /**
  129.      * PRESTAMOS
  130.      * @ORM\OneToMany(targetEntity="Prestamo", mappedBy="persona", cascade={"persist", "remove"})
  131.      */
  132.     private $prestamos;
  133.  
  134.  
  135.     /**
  136.      * GRUPOS
  137.      * @ORM\OneToMany(targetEntity="SeguridadBundle\Entity\Usergroup", mappedBy="persona", cascade={"persist", "remove"})
  138.      */
  139.     private $grupos;
  140.  
  141.     //DEPENDENCIAS
  142.     /**
  143.      * @ORM\OneToOne(targetEntity="DeteccionBundle\Entity\Seccion", mappedBy="encargado")
  144.      */
  145.     private $seccion;
  146.  
  147.     /**
  148.      * Constructor
  149.      */
  150.     public function __construct()
  151.     {
  152.         $this->prestamos = new \Doctrine\Common\Collections\ArrayCollection();
  153.         $this->grupos = new \Doctrine\Common\Collections\ArrayCollection();
  154.     }
  155.  
  156.    
  157.  
  158.     /**
  159.      * Get id
  160.      *
  161.      * @return integer
  162.      */
  163.     public function getId()
  164.     {
  165.         return $this->id;
  166.     }
  167.  
  168.     /**
  169.      * Set iden
  170.      *
  171.      * @param string $iden
  172.      *
  173.      * @return Persona
  174.      */
  175.     public function setIden($iden)
  176.     {
  177.         $this->iden = $iden;
  178.  
  179.         return $this;
  180.     }
  181.  
  182.     /**
  183.      * Get iden
  184.      *
  185.      * @return string
  186.      */
  187.     public function getIden()
  188.     {
  189.         return $this->iden;
  190.     }
  191.  
  192.     /**
  193.      * Set pnom
  194.      *
  195.      * @param string $pnom
  196.      *
  197.      * @return Persona
  198.      */
  199.     public function setPnom($pnom)
  200.     {
  201.         $this->pnom = $pnom;
  202.  
  203.         return $this;
  204.     }
  205.  
  206.     /**
  207.      * Get pnom
  208.      *
  209.      * @return string
  210.      */
  211.     public function getPnom()
  212.     {
  213.         return $this->pnom;
  214.     }
  215.  
  216.     /**
  217.      * Set snom
  218.      *
  219.      * @param string $snom
  220.      *
  221.      * @return Persona
  222.      */
  223.     public function setSnom($snom)
  224.     {
  225.         $this->snom = $snom;
  226.  
  227.         return $this;
  228.     }
  229.  
  230.     /**
  231.      * Get snom
  232.      *
  233.      * @return string
  234.      */
  235.     public function getSnom()
  236.     {
  237.         return $this->snom;
  238.     }
  239.  
  240.     /**
  241.      * Set ape
  242.      *
  243.      * @param string $ape
  244.      *
  245.      * @return Persona
  246.      */
  247.     public function setApe($ape)
  248.     {
  249.         $this->ape = $ape;
  250.  
  251.         return $this;
  252.     }
  253.  
  254.     /**
  255.      * Get ape
  256.      *
  257.      * @return string
  258.      */
  259.     public function getApe()
  260.     {
  261.         return $this->ape;
  262.     }
  263.  
  264.     /**
  265.      * Set gen
  266.      *
  267.      * @param string $gen
  268.      *
  269.      * @return Persona
  270.      */
  271.     public function setGen($gen)
  272.     {
  273.         $this->gen = $gen;
  274.  
  275.         return $this;
  276.     }
  277.  
  278.     /**
  279.      * Get gen
  280.      *
  281.      * @return string
  282.      */
  283.     public function getGen()
  284.     {
  285.         return $this->gen;
  286.     }
  287.  
  288.     /**
  289.      * Set tel1
  290.      *
  291.      * @param integer $tel1
  292.      *
  293.      * @return Persona
  294.      */
  295.     public function setTel1($tel1)
  296.     {
  297.         $this->tel1 = $tel1;
  298.  
  299.         return $this;
  300.     }
  301.  
  302.     /**
  303.      * Get tel1
  304.      *
  305.      * @return integer
  306.      */
  307.     public function getTel1()
  308.     {
  309.         return $this->tel1;
  310.     }
  311.  
  312.     /**
  313.      * Set tel2
  314.      *
  315.      * @param integer $tel2
  316.      *
  317.      * @return Persona
  318.      */
  319.     public function setTel2($tel2)
  320.     {
  321.         $this->tel2 = $tel2;
  322.  
  323.         return $this;
  324.     }
  325.  
  326.     /**
  327.      * Get tel2
  328.      *
  329.      * @return integer
  330.      */
  331.     public function getTel2()
  332.     {
  333.         return $this->tel2;
  334.     }
  335.  
  336.     /**
  337.      * Set dir
  338.      *
  339.      * @param string $dir
  340.      *
  341.      * @return Persona
  342.      */
  343.     public function setDir($dir)
  344.     {
  345.         $this->dir = $dir;
  346.  
  347.         return $this;
  348.     }
  349.  
  350.     /**
  351.      * Get dir
  352.      *
  353.      * @return string
  354.      */
  355.     public function getDir()
  356.     {
  357.         return $this->dir;
  358.     }
  359.  
  360.     /**
  361.      * Set prog
  362.      *
  363.      * @param string $prog
  364.      *
  365.      * @return Persona
  366.      */
  367.     public function setProg($prog)
  368.     {
  369.         $this->prog = $prog;
  370.  
  371.         return $this;
  372.     }
  373.  
  374.     /**
  375.      * Get prog
  376.      *
  377.      * @return string
  378.      */
  379.     public function getProg()
  380.     {
  381.         return $this->prog;
  382.     }
  383.  
  384.     /**
  385.      * Set sem
  386.      *
  387.      * @param integer $sem
  388.      *
  389.      * @return Persona
  390.      */
  391.     public function setSem($sem)
  392.     {
  393.         $this->sem = $sem;
  394.  
  395.         return $this;
  396.     }
  397.  
  398.     /**
  399.      * Get sem
  400.      *
  401.      * @return integer
  402.      */
  403.     public function getSem()
  404.     {
  405.         return $this->sem;
  406.     }
  407.  
  408.     /**
  409.      * Add prestamo
  410.      *
  411.      * @param \PrestamoBundle\Entity\Prestamo $prestamo
  412.      *
  413.      * @return Persona
  414.      */
  415.     public function addPrestamo(\PrestamoBundle\Entity\Prestamo $prestamo)
  416.     {
  417.         $this->prestamos[] = $prestamo;
  418.  
  419.         return $this;
  420.     }
  421.  
  422.     /**
  423.      * Remove prestamo
  424.      *
  425.      * @param \PrestamoBundle\Entity\Prestamo $prestamo
  426.      */
  427.     public function removePrestamo(\PrestamoBundle\Entity\Prestamo $prestamo)
  428.     {
  429.         $this->prestamos->removeElement($prestamo);
  430.     }
  431.  
  432.     /**
  433.      * Get prestamos
  434.      *
  435.      * @return \Doctrine\Common\Collections\Collection
  436.      */
  437.     public function getPrestamos()
  438.     {
  439.         return $this->prestamos;
  440.     }
  441.  
  442.     /**
  443.      * Add grupo
  444.      *
  445.      * @param \SeguridadBundle\Entity\Usergroup $grupo
  446.      *
  447.      * @return Persona
  448.      */
  449.     public function addGrupo(\SeguridadBundle\Entity\Usergroup $grupo)
  450.     {
  451.         $this->grupos[] = $grupo;
  452.  
  453.         return $this;
  454.     }
  455.  
  456.     /**
  457.      * Remove grupo
  458.      *
  459.      * @param \SeguridadBundle\Entity\Usergroup $grupo
  460.      */
  461.     public function removeGrupo(\SeguridadBundle\Entity\Usergroup $grupo)
  462.     {
  463.         $this->grupos->removeElement($grupo);
  464.     }
  465.  
  466.     /**
  467.      * Get grupos
  468.      *
  469.      * @return \Doctrine\Common\Collections\Collection
  470.      */
  471.     public function getGrupos()
  472.     {
  473.         return $this->grupos;
  474.     }
  475.  
  476.     /**
  477.      * Set seccion
  478.      *
  479.      * @param \DeteccionBundle\Entity\Seccion $seccion
  480.      *
  481.      * @return Persona
  482.      */
  483.     public function setSeccion(\DeteccionBundle\Entity\Seccion $seccion = null)
  484.     {
  485.         $this->seccion = $seccion;
  486.  
  487.         return $this;
  488.     }
  489.  
  490.     /**
  491.      * Get seccion
  492.      *
  493.      * @return \DeteccionBundle\Entity\Seccion
  494.      */
  495.     public function getSeccion()
  496.     {
  497.         return $this->seccion;
  498.     }
  499. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement