Slide 40
Slide 40 text
Erik Witthauer
Requirements Conguration Documents SubDocuments Property annotations Repository Further readings Ende
Repository - Find with limit, skipping, sorting and
one condition
Find all entries that have not set eld 'deleted' or where this
eld is 'false'
Order by 'twitterId' DESC
1 p u b l i c function findWithLimit ( $ l i m i t = 50 , $skip = 0)
2 {
3 $qb = $this −>createQueryBuilder () ;
4 /∗∗ @var Cursor $ r e s u l t ∗/
5 $ r e s u l t = $qb−>f i e l d ( ' deleted ' )−>notEqual ( true )
6 −>skip ( $skip )
7 −>l i m i t ( $ l i m i t )
8 −>s o r t ( ' t w i t t e r I d ' , −1)
9 −>getQuery ()
10 −>execute () ;
11 return $result −>hydrate () ;
12 }