Merge branch 'master' into feature_highcharts
This commit is contained in:
commit
82c22679a3
|
@ -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),
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue