Ojs\JournalBundle\Entity\Journal::setCountry PHP Method

setCountry() public method

Set country
public setCountry ( BulutYazilim\LocationBundle\Entity\Country $country = null ) : Journal
$country BulutYazilim\LocationBundle\Entity\Country
return Journal
    public function setCountry(Country $country = null)
    {
        $this->country = $country;
        return $this;
    }

Usage Example

Example #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()));
 }
Journal