public static function getRevisionRecords($options = [])
    {
        $options = Util::prepareOptions($options, [
            'indexField' => false,
            'conditions' => [],
            'order' => false,
            'limit' => false,
            'offset' => 0,
        ]);

        $query = 'SELECT * FROM `%s` WHERE (%s)';
        $params = [
            static::getHistoryTable(),
            count($options['conditions']) ? join(') AND (', static::_mapConditions($options['conditions'])) : 1,
        ];

        if ($options['order']) {
            $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order']));
        }

        if ($options['limit']) {
            $query .= sprintf(' LIMIT %u,%u', $options['offset'], $options['limit']);
        }


        if ($options['indexField']) {
            return DB::table(static::_cn($options['indexField']), $query, $params);
        } else {
            return DB::allRecords($query, $params);
        }
    }
public static function getRevisionRecords($options = [])
    {
        $options = Util::prepareOptions($options, [
            'indexField' => false,
            'conditions' => [],
            'order' => false,
            'limit' => false,
            'offset' => 0,
        ]);

        $query = 'SELECT * FROM `%s` WHERE (%s)';
        $params = [
            static::getHistoryTable(),
            count($options['conditions']) ? join(') AND (', static::_mapConditions($options['conditions'])) : 1,
        ];

        if ($options['order']) {
            $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order']));
        }

        if ($options['limit']) {
            $query .= sprintf(' LIMIT %u,%u', $options['offset'], $options['limit']);
        }


        if ($options['indexField']) {
            return DB::table(static::_cn($options['indexField']), $query, $params);
        } else {
            return DB::allRecords($query, $params);
        }
    }
public static function getRevisionRecords ( $ options = [ ] ) { $ options = Util :: prepareOptions ( $ options , [ 'indexField' => false , 'conditions' => [ ] , 'order' => false , 'limit' => false , 'offset' => 0 , ] ) ; $ query = 'SELECT * FROM `%s` WHERE (%s)' ; $ params = [ static :: getHistoryTable ( ) , count ( $ options [ 'conditions' ] ) ? join ( ') AND (' , static :: _mapConditions ( $ options [ 'conditions' ] ) ) : 1 , ] ; if ( $ options [ 'order' ] ) { $ query .= ' ORDER BY ' . join ( ',' , static :: _mapFieldOrder ( $ options [ 'order' ] ) ) ; } if ( $ options [ 'limit' ] ) { $ query .= sprintf ( ' LIMIT %u,%u' , $ options [ 'offset' ] , $ options [ 'limit' ] ) ; } if ( $ options [ 'indexField' ] ) { return DB :: table ( static :: _cn ( $ options [ 'indexField' ] ) , $ query , $ params ) ; } else { return DB :: allRecords ( $ query , $ params ) ; } }
Gets raw revision data from the database and constructs a query

@param array $options Query options
@return array
Gets raw revision data from the database and constructs a query