Ejemplo n.º 1
0
 /**
  * @param Portfolio $portfolio
  *
  * @return array
  */
 public function getPortfolioData(Portfolio $portfolio)
 {
     /** @var \Icap\PortfolioBundle\Entity\PortfolioWidget[] $portfolioWidgets */
     $portfolioWidgets = $this->widgetsManager->getByPortfolioForGridster($portfolio);
     /** @var \Icap\PortfolioBundle\Entity\PortfolioComment[] $comments */
     $comments = $this->entityManager->getRepository('IcapPortfolioBundle:PortfolioComment')->findSome($portfolio);
     $data = array('id' => $portfolio->getId(), 'title' => $portfolio->getTitle(), 'portfolioWidgets' => []);
     foreach ($portfolioWidgets as $portfolioWidget) {
         $data['portfolioWidgets'][] = $this->widgetsManager->getPortfolioWidgetData($portfolioWidget);
     }
     $commentsDatas = array();
     foreach ($comments as $comment) {
         $commentsDatas[] = $comment->getData();
     }
     $data['comments'] = $commentsDatas;
     $data['unreadComments'] = $portfolio->getCountUnreadComments();
     $data['commentsViewAt'] = $portfolio->getCommentsViewAt()->format(DATE_W3C);
     return $data;
 }
Ejemplo n.º 2
0
 /**
  * @param WidgetFindEvent $widgetFindEvent
  *
  * @DI\Observe("icap_portfolio_widget_find_userInformation")
  * @DI\Observe("icap_portfolio_widget_find_text")
  * @DI\Observe("icap_portfolio_widget_find_skills")
  * @DI\Observe("icap_portfolio_widget_find_formations")
  * @DI\Observe("icap_portfolio_widget_find_experience")
  */
 public function onWidgetFind(WidgetFindEvent $widgetFindEvent)
 {
     $widgetFindEvent->setWidget($this->widgetManager->getWidget($widgetFindEvent->getWidgetType(), $widgetFindEvent->getWidgetId(), $widgetFindEvent->getUser()));
 }