Commit 3953b7d438b8185b315d1efdd708aa18e0a71d38

Authored by Wilmer Ramones
1 parent b249e68422
Exists in master

renombrado areapersona a areainsitutcion para tener mas semantica y acomodada to…

…das la dependicias de la entidad
src/AppBundle/Controller/PortalController.php
... ... @@ -63,7 +63,7 @@ class PortalController extends Controller
63 63 $rep = $this->getDoctrine()->getRepository('AppBundle:Rol');
64 64 //Actualizar el PFG de la persona
65 65 $actualizarRol = $rep->findOneByIdPersona($rol->getIdRol()->getIdPersona());
66   - $actualizarRol->setIdAreaPersona($form->get('pfg')->getData() );
  66 + $actualizarRol->setIdAreaInstitucion($form->get('pfg')->getData() );
67 67  
68 68 $em = $this->getDoctrine()->getManager();
69 69 $em->persist($login);
... ...
src/AppBundle/Entity/AreaInstitucion.php
... ... @@ -0,0 +1,121 @@
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: ubv-cipee
  5 + * Date: 29/06/16
  6 + * Time: 08:07 AM
  7 + */
  8 +
  9 +
  10 +
  11 +namespace AppBundle\Entity;
  12 +
  13 +use Doctrine\ORM\Mapping as ORM;
  14 +
  15 +/**
  16 + * AreaInstitucion
  17 + *
  18 + * @ORM\Table(name="area_institucion", uniqueConstraints={@ORM\UniqueConstraint(name="area_institucion_nombre_key", columns={"nombre"})})
  19 + * @ORM\Entity
  20 + */
  21 +class AreaInstitucion
  22 +{
  23 + /**
  24 + * @var string
  25 + *
  26 + * @ORM\Column(name="nombre", type="string", length=80, nullable=false, options={"comment" = "identificador del area de desenvolvimiento de persona"})
  27 + */
  28 + private $nombre;
  29 +
  30 + /**
  31 + * @var integer
  32 + *
  33 + * @ORM\Column(name="id", type="integer",nullable=false, options={"comment" = "nombre del area donde hace vida la persona"})
  34 + * @ORM\Id
  35 + * @ORM\GeneratedValue(strategy="IDENTITY")
  36 + * @ORM\SequenceGenerator(sequenceName="area_persona_id_seq", allocationSize=1, initialValue=1)
  37 + */
  38 + private $id;
  39 +
  40 + /**
  41 + * @var \AppBundle\Entity\TipoArea
  42 + *
  43 + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TipoArea")
  44 + * @ORM\JoinColumns({
  45 + * @ORM\JoinColumn(name="id_tipo_area", referencedColumnName="id", nullable=false)
  46 + * })
  47 + */
  48 + private $idTipoArea;
  49 +
  50 +
  51 +
  52 + /**
  53 + * Set nombre
  54 + *
  55 + * @param string $nombre
  56 + * @return AreaInstitucion
  57 + */
  58 + public function setNombre($nombre)
  59 + {
  60 + $this->nombre = $nombre;
  61 +
  62 + return $this;
  63 + }
  64 +
  65 + /**
  66 + * Get nombre
  67 + *
  68 + * @return string
  69 + */
  70 + public function getNombre()
  71 + {
  72 + return $this->nombre;
  73 + }
  74 +
  75 + /**
  76 + * Get id
  77 + *
  78 + * @return integer
  79 + */
  80 + public function getId()
  81 + {
  82 + return $this->id;
  83 + }
  84 +
  85 +
  86 + /**
  87 + * Get nombre
  88 + *
  89 + * @return string
  90 + */
  91 + public function __toString()
  92 + {
  93 + return $this->nombre;
  94 + }
  95 +
  96 +
  97 + /**
  98 + * Set idTipoArea
  99 + *
  100 + * @param \AppBundle\Entity\Estado $idTipoArea
  101 + * @return TipoArea
  102 + */
  103 + public function setIdTipoArea(\AppBundle\Entity\TipoArea $idTipoArea = null)
  104 + {
  105 + $this->idEstado = $idTipoArea;
  106 +
  107 + return $this;
  108 + }
  109 +
  110 + /**
  111 + * Get idTipoArea
  112 + *
  113 + * @return \AppBundle\Entity\TipoArea
  114 + */
  115 + public function getIdTipoArea()
  116 + {
  117 + return $this->idTipoArea;
  118 + }
  119 +
  120 +
  121 +}
0 122 \ No newline at end of file
... ...
src/AppBundle/Entity/AreaPersona.php
... ... @@ -1,121 +0,0 @@
1   -<?php
2   -/**
3   - * Created by PhpStorm.
4   - * User: ubv-cipee
5   - * Date: 29/06/16
6   - * Time: 08:07 AM
7   - */
8   -
9   -
10   -
11   -namespace AppBundle\Entity;
12   -
13   -use Doctrine\ORM\Mapping as ORM;
14   -
15   -/**
16   - * AreaPersona
17   - *
18   - * @ORM\Table(name="area_persona", uniqueConstraints={@ORM\UniqueConstraint(name="area_persona_nombre_key", columns={"nombre"})})
19   - * @ORM\Entity
20   - */
21   -class AreaPersona
22   -{
23   - /**
24   - * @var string
25   - *
26   - * @ORM\Column(name="nombre", type="string", length=80, nullable=false, options={"comment" = "identificador del area de desenvolvimiento de persona"})
27   - */
28   - private $nombre;
29   -
30   - /**
31   - * @var integer
32   - *
33   - * @ORM\Column(name="id", type="integer",nullable=false, options={"comment" = "nombre del area donde hace vida la persona"})
34   - * @ORM\Id
35   - * @ORM\GeneratedValue(strategy="IDENTITY")
36   - * @ORM\SequenceGenerator(sequenceName="area_persona_id_seq", allocationSize=1, initialValue=1)
37   - */
38   - private $id;
39   -
40   - /**
41   - * @var \AppBundle\Entity\TipoArea
42   - *
43   - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TipoArea")
44   - * @ORM\JoinColumns({
45   - * @ORM\JoinColumn(name="id_tipo_area", referencedColumnName="id", nullable=false)
46   - * })
47   - */
48   - private $idTipoArea;
49   -
50   -
51   -
52   - /**
53   - * Set nombre
54   - *
55   - * @param string $nombre
56   - * @return AreaPersona
57   - */
58   - public function setNombre($nombre)
59   - {
60   - $this->nombre = $nombre;
61   -
62   - return $this;
63   - }
64   -
65   - /**
66   - * Get nombre
67   - *
68   - * @return string
69   - */
70   - public function getNombre()
71   - {
72   - return $this->nombre;
73   - }
74   -
75   - /**
76   - * Get id
77   - *
78   - * @return integer
79   - */
80   - public function getId()
81   - {
82   - return $this->id;
83   - }
84   -
85   -
86   - /**
87   - * Get nombre
88   - *
89   - * @return string
90   - */
91   - public function __toString()
92   - {
93   - return $this->nombre;
94   - }
95   -
96   -
97   - /**
98   - * Set idTipoArea
99   - *
100   - * @param \AppBundle\Entity\Estado $idTipoArea
101   - * @return TipoArea
102   - */
103   - public function setIdTipoArea(\AppBundle\Entity\TipoArea $idTipoArea = null)
104   - {
105   - $this->idEstado = $idTipoArea;
106   -
107   - return $this;
108   - }
109   -
110   - /**
111   - * Get idTipoArea
112   - *
113   - * @return \AppBundle\Entity\TipoArea
114   - */
115   - public function getIdTipoArea()
116   - {
117   - return $this->idTipoArea;
118   - }
119   -
120   -
121   -}
122 0 \ No newline at end of file
src/AppBundle/Entity/Rol.php
... ... @@ -52,14 +52,14 @@ class Rol
52 52  
53 53  
54 54 /**
55   - * @var \AppBundle\Entity\AreaPersona
  55 + * @var \AppBundle\Entity\AreaInstitucion
56 56 *
57   - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\AreaPersona")
  57 + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\AreaInstitucion")
58 58 * @ORM\JoinColumns({
59   - * @ORM\JoinColumn(name="id_area_persona", referencedColumnName="id", nullable=true)
  59 + * @ORM\JoinColumn(name="id_area_institucion", referencedColumnName="id", nullable=true)
60 60 * })
61 61 */
62   - private $idAreaPersona;
  62 + private $idAreaInstitucion;
63 63  
64 64  
65 65  
... ... @@ -163,19 +163,19 @@ class Rol
163 163 }
164 164  
165 165 /**
166   - * @return AreaPersona
  166 + * @return AreaInstitucion
167 167 */
168   - public function getIdAreaPersona()
  168 + public function getIdAreaInstitucion()
169 169 {
170   - return $this->idAreaPersona;
  170 + return $this->idAreaInstitucion;
171 171 }
172 172  
173 173 /**
174   - * @param AreaPersona $idAreaPersona
  174 + * @param AreaInstitucion $idAreaInstitucion
175 175 */
176   - public function setIdAreaPersona($idAreaPersona)
  176 + public function setIdAreaInstitucion($idAreaInstitucion)
177 177 {
178   - $this->idAreaPersona = $idAreaPersona;
  178 + $this->idAreaInstitucion = $idAreaInstitucion;
179 179 }
180 180  
181 181 }
182 182 \ No newline at end of file
... ...
src/AppBundle/Form/SolicitarType.php
... ... @@ -58,7 +58,7 @@ class SolicitarType extends AbstractType
58 58  
59 59 ->add('pfg', EntityType::class, array(
60 60 'placeholder' => 'Seleccione PFG al cual está adscrito',
61   - 'class' => 'AppBundle:AreaPersona',
  61 + 'class' => 'AppBundle:AreaInstitucion',
62 62 'query_builder' => function(EntityRepository $er){
63 63 return $er->createQueryBuilder('pfg')
64 64 ->where('pfg.idTipoArea = 1');
... ...