Update search

This commit is contained in:
ryan committed 2024-05-16 01:25:08 -04:00
1 parent 15f486205d
commit f4d17bb7dc
4 files changed
+64 -8

No files matched your search

+16
View File
@@ -29,6 +29,22 @@ class NoteRepository extends ServiceEntityRepository
return $ret;
}
public function findNote(string $query, string $userId): array
{
$ret = $this->createQueryBuilder('n')
->orderBy('n.date', 'DESC')
->where('n.title LIKE :query')
->orWhere('n.passage LIKE :query')
->andWhere('n.user = :user')
->setParameter('query', "%{$query}%")
->setParameter('user', $userId)
->setMaxResults(3)
->getQuery()
->getResult();
return $ret;
}
// /**
// * @return Note[] Returns an array of Note objects
// */