Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
PostSummaryQuery | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
getResult | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Flow\Formatter; |
4 | |
5 | use Flow\Model\UUID; |
6 | |
7 | class PostSummaryQuery extends AbstractQuery { |
8 | /** |
9 | * @param UUID $postId |
10 | * @return FormatterRow|null |
11 | */ |
12 | public function getResult( UUID $postId ) { |
13 | $found = $this->storage->find( |
14 | 'PostSummary', |
15 | [ 'rev_type_id' => $postId ], |
16 | [ 'sort' => 'rev_id', 'order' => 'DESC', 'limit' => 1 ] |
17 | ); |
18 | if ( !$found ) { |
19 | return null; |
20 | } |
21 | $this->loadMetadataBatch( $found ); |
22 | |
23 | return $this->buildResult( reset( $found ), 'rev_id' ); |
24 | } |
25 | } |