Fixed getLast4Notes method
This commit is contained in:
parent
06cbc286a6
commit
b817ac7e23
@ -19,13 +19,17 @@ class NoteRepository extends ServiceEntityRepository
|
||||
|
||||
public function getLast4Notes(?User $user): array
|
||||
{
|
||||
if (!$user) {
|
||||
return [];
|
||||
}
|
||||
$ret = $this->createQueryBuilder('n')
|
||||
->where('n.user = :user')
|
||||
->setParameter('user', (string) $user->getId())
|
||||
->setParameter('user', $user->getId()->toBinary())
|
||||
->orderBy('n.date', 'DESC')
|
||||
->setMaxResults(4)
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user