Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
PostSummaryRevisionBoardHistoryStorage
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 find
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace Flow\Data\Storage;
4
5use Flow\Model\UUID;
6
7class PostSummaryRevisionBoardHistoryStorage 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->newSelectQueryBuilder()
18            ->select( '*' )
19            ->from( 'flow_revision' )
20            ->join( 'flow_tree_node', null, 'rev_type_id = tree_descendant_id' )
21            ->join( 'flow_topic_list', null, 'topic_id = tree_ancestor_id' )
22            ->where( [ 'rev_type' => 'post-summary' ] )
23            ->andWhere( $attributes )
24            ->options( $options )
25            ->caller( __METHOD__ )
26            ->fetchResultSet();
27
28        $retval = [];
29        foreach ( $res as $row ) {
30            $row = UUID::convertUUIDs( (array)$row, 'alphadecimal' );
31            $retval[$row['rev_id']] = $row;
32        }
33
34        return $retval;
35    }
36}