Пример #1
0
 /**
  * Sets the isPublished state of this entity, to the $publishState provided.
  * 
  * @param WorkHistory $workHistory The Work History to update published state.
  * 
  * @param boolean $publishState True/False state.
  */
 private function changePublishState(WorkHistory $workHistory, $publishState)
 {
     $workHistory->setIsPublished($publishState);
     $em = $this->getDoctrine()->getManager();
     $em->persist($workHistory);
     $em->flush();
     $this->get('session')->getFlashBag()->add('notice', json_encode(array('title' => 'Published state has been updated!', 'level' => 'info')));
     return $this->redirect($this->generateUrl('admin_' . $this->ogEntity->getRouteStem()));
 }