Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
poll_title
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 get_columns
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 get_records_by_range_query
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14namespace phpbb\textreparser\plugins;
15
16class poll_title extends \phpbb\textreparser\row_based_plugin
17{
18    /**
19    * {@inheritdoc}
20    */
21    public function get_columns()
22    {
23        return array(
24            'id'   => 'topic_id',
25            'text' => 'poll_title',
26        );
27    }
28
29    /**
30    * {@inheritdoc}
31    */
32    protected function get_records_by_range_query($min_id, $max_id)
33    {
34        $sql = 'SELECT t.topic_id AS id, t.poll_title AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid
35            FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
36            WHERE t.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .'
37                AND t.poll_start > 0
38                AND p.post_id = t.topic_first_post_id';
39
40        return $sql;
41    }
42}