Add method to retrieve ordered staff notes
This commit is contained in:
parent
c5b8148f00
commit
91110c037e
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\MemberCase;
|
||||
use App\Entity\StaffNote;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
@ -16,6 +17,16 @@ class StaffNoteRepository extends ServiceEntityRepository
|
||||
parent::__construct($registry, StaffNote::class);
|
||||
}
|
||||
|
||||
public function getOrderedNotes(MemberCase $case): array
|
||||
{
|
||||
return $this->createQueryBuilder('s')
|
||||
->andWhere('s.memberCase = :case')
|
||||
->setParameter('case', $case->getId()->toBinary())
|
||||
->orderBy('s.date', 'DESC')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return StaffNote[] Returns an array of StaffNote objects
|
||||
// */
|
||||
|
Loading…
Reference in New Issue
Block a user