Merge branch 'master' into feature_highcharts

This commit is contained in:
Alexey Skobkin 2015-06-26 19:18:17 +03:00
commit 82c22679a3
2 changed files with 4 additions and 3 deletions

View file

@ -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),
]);
}

View file

@ -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)