diff options
Diffstat (limited to 'phpBB/phpbb/db/sql_insert_buffer.php')
-rw-r--r-- | phpBB/phpbb/db/sql_insert_buffer.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/phpBB/phpbb/db/sql_insert_buffer.php b/phpBB/phpbb/db/sql_insert_buffer.php index 41026ad425..18e4814a77 100644 --- a/phpBB/phpbb/db/sql_insert_buffer.php +++ b/phpBB/phpbb/db/sql_insert_buffer.php @@ -1,9 +1,13 @@ <?php /** * -* @package dbal -* @copyright (c) 2013 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. * */ @@ -44,12 +48,10 @@ namespace phpbb\db; * * $buffer->flush(); * </code> -* -* @package dbal */ class sql_insert_buffer { - /** @var \phpbb\db\driver\driver */ + /** @var \phpbb\db\driver\driver_interface */ protected $db; /** @var string */ @@ -62,11 +64,11 @@ class sql_insert_buffer protected $buffer = array(); /** - * @param \phpbb\db\driver\driver $db + * @param \phpbb\db\driver\driver_interface $db * @param string $table_name * @param int $max_buffered_rows */ - public function __construct(\phpbb\db\driver\driver $db, $table_name, $max_buffered_rows = 500) + public function __construct(\phpbb\db\driver\driver_interface $db, $table_name, $max_buffered_rows = 500) { $this->db = $db; $this->table_name = $table_name; @@ -90,7 +92,7 @@ class sql_insert_buffer // Flush buffer if it is full or when DB does not support multi inserts. // In the later case, the buffer will always only contain one row. - if (!$this->db->multi_insert || sizeof($this->buffer) >= $this->max_buffered_rows) + if (!$this->db->get_multi_insert() || sizeof($this->buffer) >= $this->max_buffered_rows) { return $this->flush(); } @@ -105,7 +107,7 @@ class sql_insert_buffer * first building a huge rowset. Or at least sizeof($rows) should be kept * small. * - * @param array $rows + * @param array $rows * * @return bool True when some data was flushed to the database. * False otherwise. |