예제 #1
0
 /**
  * Sets the isPublished state of this entity, to the $publishState provided.
  * 
  * @param ProjectHistory $projectHistory The Project History to update published state.
  * 
  * @param boolean $publishState True/False state.
  */
 private function changePublishState(ProjectHistory $projectHistory, $publishState)
 {
     $projectHistory->setIsPublished($publishState);
     $em = $this->getDoctrine()->getManager();
     $em->persist($projectHistory);
     $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()));
 }
예제 #2
0
 public function renderProjectHistory(ProjectHistory $projectHistory)
 {
     $template_choice = $this->container->get('ilp_bootstrap_theme.theme_manager')->getTemplateChoice();
     $securityContext = $this->container->get('security.context');
     if (!$securityContext->isGranted('IS_AUTHENTICATED_FULLY')) {
         if (!$projectHistory->getIsPublished()) {
             throw $this->createNotFoundException('The Project Record you are looking for was not found.');
         }
     }
     return $this->render('CorvusFrontendBundle:' . $template_choice . ':projectHistoryId.html.twig', array('projectHistory' => $projectHistory));
 }
예제 #3
0
 public function __construct(EntityManager $em)
 {
     $this->originalEntityName = ProjectHistory::getRepoName();
     parent::__construct($em);
 }
예제 #4
0
 public function load(ObjectManager $manager)
 {
     $projectHistory = new ProjectHistory();
     $projectHistory->setRowOrder(1);
     $projectHistory->setProjectName('Secretary Lucy\'s Fansite');
     $projectHistory->setProjectDescription('Creating and constantly looking at a fansite for the fantastic secretary lucy.');
     $projectHistory->setRole('Creator and administrator');
     $projectHistory->setProcess('Stalked her around the office for a while. Also took a few photos. Then created the amazing fansite');
     $projectHistory->setFeedbackReceived('Lucy says if she ever finds out who made the fansite she would hurt them :( #ForeverAlone');
     $projectHistory->setReflection('Probably shouldnt have shown lucy the website. Now she just thinks im weird!');
     $projectHistory->setUrl('http://www.lucyisthebest.com');
     $projectHistory->setMetaTitle('Secretary Lucys Fansite |');
     $projectHistory->setMetaDescription('Best website ever');
     $manager->persist($projectHistory);
     $manager->flush();
 }