/**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('12345');
     $paymentcontact->setName('Jose Perez');
     $paymentcontact->setPhone('8111845854');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('Finanzas');
     $paymentcontact->setCustomer($this->getReference('customer2'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact1', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('23456');
     $paymentcontact->setName('Jorge Gonzalez');
     $paymentcontact->setPhone('811184000');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('RH');
     $paymentcontact->setCustomer($this->getReference('customer2'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact2', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('4611564');
     $paymentcontact->setName('Ana Gutierrez');
     $paymentcontact->setPhone('8111896581');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('RH');
     $paymentcontact->setCustomer($this->getReference('customer4'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact3', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('267889');
     $paymentcontact->setName('Carlos Hermosillo');
     $paymentcontact->setPhone('8181234567');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('Deportes');
     $paymentcontact->setCustomer($this->getReference('customer4'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact4', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('41255255');
     $paymentcontact->setName('Jorge Campos');
     $paymentcontact->setPhone('8181475289');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('Deportes');
     $paymentcontact->setCustomer($this->getReference('customer5'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact5', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('3698255');
     $paymentcontact->setName('Roberto Carlos');
     $paymentcontact->setPhone('8111845854');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('Finanzas');
     $paymentcontact->setCustomer($this->getReference('customer6'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact6', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('2125861');
     $paymentcontact->setName('Maria Dominguez');
     $paymentcontact->setPhone('8112358974');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('Ventas');
     $paymentcontact->setCustomer($this->getReference('customer7'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact7', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('3514935');
     $paymentcontact->setName('Jorge Ramirez');
     $paymentcontact->setPhone('811457845');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('Sistemas');
     $paymentcontact->setCustomer($this->getReference('customer8'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact8', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('2478965');
     $paymentcontact->setName('Gustavo Mendez');
     $paymentcontact->setPhone('8111382830');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('Direccion');
     $paymentcontact->setCustomer($this->getReference('customer9'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact9', $paymentcontact);
     $paymentcontact = new PaymentContact();
     $paymentcontact->setEmployeenumber('1284567');
     $paymentcontact->setName('Francisco Rocha');
     $paymentcontact->setPhone('8111899689');
     $paymentcontact->setEmail('*****@*****.**');
     $paymentcontact->setDepartment('Direccion');
     $paymentcontact->setCustomer($this->getReference('customer9'));
     $manager->persist($paymentcontact);
     $manager->flush();
     $this->addReference('paymentcontact10', $paymentcontact);
 }
 public function createPaymentContactAction()
 {
     $name = $this->get('request')->get('contactName');
     $customerId = $this->get('request')->get('customerId');
     $em = $this->getDoctrine()->getManager();
     $paymentContact = new PaymentContact();
     $paymentContact->setName($name);
     $customer = $em->getRepository("InodataFloraBundle:Customer")->find($customerId);
     if ($customer) {
         $paymentContact->setCustomer($customer);
     }
     $em->persist($paymentContact);
     $em->flush();
     $response = $this->getPaymentCotactInfoAsArray($paymentContact);
     return new Response(json_encode($response));
 }