public function loadSeccionDoce(ObjectManager $manager) { $seccionDoce = array(array(1, 1, 5), array(2, 8, 11), array(4, 9, 11), array(5, 10, 29), array(6, 11, 21), array(7, 12, 29), array(8, 13, 3), array(9, 2, 11), array(10, 3, 21), array(11, 5, 29), array(12, 4, 11), array(13, 6, 3), array(14, 7, 6), array(15, 14, 23), array(18, 15, 5), array(19, 16, 11), array(20, 17, 23), array(21, 18, 8), array(22, 21, 3), array(23, 20, 23), array(24, 19, 29), array(25, 22, 21), array(26, 23, 5), array(27, 24, 11), array(28, 25, 23), array(29, 26, 8), array(30, 27, 29), array(31, 28, 11), array(32, 29, 26), array(33, 30, 5), array(34, 31, 11), array(35, 32, 23), array(36, 33, 8), array(37, 34, 29), array(38, 35, 11), array(39, 36, 26), array(40, 37, 21), array(41, 38, 11), array(42, 39, 29), array(43, 40, 6), array(44, 41, 26), array(45, 45, 21), array(46, 43, 4), array(47, 46, 4), array(48, 47, 61), array(49, 49, 77), array(50, 50, 38), array(51, 51, 25), array(52, 52, 34), array(53, 53, 51)); $em = $this->container->get('doctrine')->getEntityManager('default'); foreach ($seccionDoce as $data) { $entitySeccionDoce = new SeccionDoce(); //$entitySeccionDoce->setId($data[0]); $entitySeccion = $em->getRepository('AppBundle:Seccion')->find($data[1]); $entitySeccionDoce->setSecc($entitySeccion); $entityPersona = $em->getRepository('AppBundle:Persona')->find($data[2]); $entitySeccionDoce->setPersona($entityPersona); $manager->persist($entitySeccionDoce); } $manager->flush(); }
/** * Set doce. * * @param \AppBundle\Entity\SeccionDoce $doce * * @return Seccion */ public function setDoce(\AppBundle\Entity\SeccionDoce $doce = null) { $this->doce = $doce; $this->doce->setSecc($this); return $this; }