setCountry() public method

Set country
public setCountry ( BulutYazilim\LocationBundle\Entity\Country $country = null ) : Journal
$country BulutYazilim\LocationBundle\Entity\Country
return Journal
Beispiel #1
0
 /**
  * Displays a form to create a new Journal entity.
  *
  * @param Request $request
  * @return Response
  */
 public function newAction(Request $request)
 {
     $em = $this->getDoctrine()->getManager();
     $defaultCountry = $em->getRepository('BulutYazilimLocationBundle:Country')->find($this->getParameter('country_id'));
     $entity = new Journal();
     $entity->setCountry($defaultCountry);
     $entity->setCurrentLocale($request->getDefaultLocale());
     $form = $this->createCreateForm($entity);
     return $this->render('OjsAdminBundle:AdminJournal:new.html.twig', array('entity' => $entity, 'form' => $form->createView()));
 }