| <?php |
|
|
| |
| |
| |
| |
| |
| |
|
|
| namespace Piwik\Updater\Migration\Db; |
|
|
| use Piwik\Db; |
| use Piwik\Updater\Migration; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class BatchInsert extends Migration |
| { |
| private $table; |
| private $columnNames; |
| private $values; |
| private $throwException; |
| private $charset; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| public function __construct($table, $columnNames, $values, $throwException, $charset) |
| { |
| $this->table = $table; |
| $this->columnNames = $columnNames; |
| $this->values = $values; |
| $this->throwException = (bool) $throwException; |
| $this->charset = $charset; |
| } |
|
|
| public function shouldIgnoreError($exception) |
| { |
| return false; |
| } |
|
|
| public function __toString() |
| { |
| return '<batch insert>'; |
| } |
|
|
| public function exec() |
| { |
| Db\BatchInsert::tableInsertBatch($this->table, $this->columnNames, $this->values, $this->throwException, $this->charset); |
| } |
|
|
| public function getColumnNames() |
| { |
| return $this->columnNames; |
| } |
|
|
| |
| |
| |
| public function getTable() |
| { |
| return $this->table; |
| } |
|
|
| |
| |
| |
| public function getValues() |
| { |
| return $this->values; |
| } |
|
|
| |
| |
| |
| public function doesThrowException() |
| { |
| return $this->throwException; |
| } |
|
|
| |
| |
| |
| public function getCharset() |
| { |
| return $this->charset; |
| } |
| } |
|
|