public function onDashboardComing(\Club\UserBundle\Event\FilterActivityEvent $event) { $start = new \DateTime(); $end = clone $start; $end->add(new \DateInterval('P1M')); $schedules = $this->em->getRepository('ClubTeamBundle:Schedule')->getAllBetween($start, $end, $event->getUser()); $this->process($event, $schedules); }
public function onMemberView(\Club\UserBundle\Event\FilterActivityEvent $event) { $user = $event->getUser(); if ($this->container->getParameter('club_welcome.enable_blog')) { $blogs = $this->em->getRepository('ClubWelcomeBundle:Blog')->findBy(array('user' => $user->getId()), array('id' => 'DESC'), 10); foreach ($blogs as $b) { $activity = array('date' => $b->getCreatedAt(), 'type' => 'bundles/clublayout/images/icons/16x16/transmit.png', 'message' => $this->templating->render('ClubWelcomeBundle:Dashboard:blog_message.html.twig', array('blog' => $b)), 'link' => $this->router->generate('club_welcome_blog_show', array('blog_id' => $b->getId()))); $event->appendActivities($activity, $b->getCreatedAt()->format('U')); } } }
public function onDashboardRecent(\Club\UserBundle\Event\FilterActivityEvent $event) { $connections = $this->em->getRepository('ClubUserBundle:Connection')->getDistinct($event->getUser()); foreach ($connections as $conn) { $matches = $this->em->getRepository('ClubMatchBundle:Match')->getLatest($conn->getConnection()); if (is_array($matches)) { foreach ($matches as $m) { $activity = array('date' => $m->getCreatedAt(), 'type' => 'bundles/clublayout/images/icons/16x16/medal_gold_1.png', 'message' => $this->templating->render('ClubMatchBundle:Dashboard:match_message.html.twig', array('match' => $m)), 'link' => $this->router->generate('club_match_match_show', array('id' => $m->getId()))); $event->appendActivities($activity, $m->getCreatedAt()->format('U')); } } } }
public function onDashboardComing(\Club\UserBundle\Event\FilterActivityEvent $event) { $start = new \DateTime(); $bookings = $this->em->getRepository('ClubBookingBundle:Booking')->getAllFutureBookings($event->getUser(), $start); $this->process($event, $bookings); }
public function onMemberView(\Club\UserBundle\Event\FilterActivityEvent $event) { $events = $this->em->getRepository('ClubEventBundle:Attend')->getAttended($event->getUser()); $this->process($event, $events); }