Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
PostRevisionBoardHistoryStorage | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
find | |
0.00% |
0 / 19 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Flow\Data\Storage; |
4 | |
5 | use Flow\Model\UUID; |
6 | |
7 | class PostRevisionBoardHistoryStorage extends BoardHistoryStorage { |
8 | /** |
9 | * @param array $attributes |
10 | * @param array $options |
11 | * @return array |
12 | */ |
13 | public function find( array $attributes, array $options = [] ) { |
14 | $attributes = $this->preprocessSqlArray( $attributes ); |
15 | |
16 | $dbr = $this->dbFactory->getDB( DB_REPLICA ); |
17 | $res = $dbr->select( |
18 | [ 'flow_topic_list', 'flow_tree_node', 'flow_tree_revision', 'flow_revision' ], |
19 | [ '*' ], |
20 | array_merge( [ |
21 | 'rev_type' => 'post', |
22 | 'topic_id = tree_ancestor_id', |
23 | 'tree_descendant_id = tree_rev_descendant_id', |
24 | 'tree_rev_id = rev_id', |
25 | ], $attributes ), |
26 | __METHOD__, |
27 | $options |
28 | ); |
29 | |
30 | $retval = []; |
31 | foreach ( $res as $row ) { |
32 | $row = UUID::convertUUIDs( (array)$row, 'alphadecimal' ); |
33 | $retval[$row['rev_id']] = $row; |
34 | } |
35 | |
36 | return $retval; |
37 | } |
38 | } |