Files
piratepoet/lib/Models/StatisticsNewsletters.php
Vlad 999a0b3ede - Refactors sending queue worker by breaking it into smaller tasks
- Adds arrayUnique method to Helpers for multidimensional arrays
2016-06-17 14:52:56 -04:00

27 lines
578 B
PHP

<?php
namespace MailPoet\Models;
if(!defined('ABSPATH')) exit;
class StatisticsNewsletters extends Model {
public static $_table = MP_STATISTICS_NEWSLETTERS_TABLE;
function __construct() {
parent::__construct();
}
static function createMultiple($data) {
if (count($data) % 3 !== 0) {
return false;
}
return self::rawExecute(
'INSERT INTO `' . self::$_table . '` ' .
'(newsletter_id, subscriber_id, queue_id) ' .
'VALUES ' . rtrim(
str_repeat('(?,?,?), ', count($data)/3),
', '
),
$data
);
}
}