diff --git a/src/Skobkin/Bundle/PointToolsBundle/Controller/UserController.php b/src/Skobkin/Bundle/PointToolsBundle/Controller/UserController.php index 42c160b..4a78cc9 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Controller/UserController.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Controller/UserController.php @@ -32,7 +32,7 @@ class UserController extends Controller return $this->render('SkobkinPointToolsBundle:User:show.html.twig', [ 'user' => $user, 'subscribers' => $em->getRepository('SkobkinPointToolsBundle:User')->findUserSubscribersById($user->getId()), - 'log' => $em->getRepository('SkobkinPointToolsBundle:SubscriptionEvent')->getUserLastSubscriptionEventsById($user, 10), + 'log' => $em->getRepository('SkobkinPointToolsBundle:SubscriptionEvent')->getUserLastSubscribersEventsById($user, 10), 'avatar_url' => $userApi->getAvatarUrl($user, UserApi::AVATAR_SIZE_LARGE), ]); } diff --git a/src/Skobkin/Bundle/PointToolsBundle/Entity/SubscriptionEventRepository.php b/src/Skobkin/Bundle/PointToolsBundle/Entity/SubscriptionEventRepository.php index f17f01c..b12332c 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Entity/SubscriptionEventRepository.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Entity/SubscriptionEventRepository.php @@ -29,7 +29,7 @@ class SubscriptionEventRepository extends EntityRepository * @param integer $limit * @return SubscriptionEvent[] */ - public function getUserLastSubscriptionEventsById(User $user, $limit) + public function getUserLastSubscribersEventsById(User $user, $limit) { if (!is_int($limit)) { throw new \InvalidArgumentException('$limit must be an integer'); @@ -38,7 +38,8 @@ class SubscriptionEventRepository extends EntityRepository $qb = $this->createQueryBuilder('se'); return $qb - ->select() + ->select(['se', 's']) + ->join('se.subscriber', 's') ->where('se.author = :author') ->orderBy('se.date', 'desc') ->setMaxResults($limit)