- Implements link extraction, processing, replacement and saving

This commit is contained in:
Vlad
2016-04-13 20:07:01 -04:00
parent 809be415c5
commit f1b955d74a
8 changed files with 304 additions and 128 deletions

View File

@@ -0,0 +1,12 @@
<?php
namespace MailPoet\Models;
if(!defined('ABSPATH')) exit;
class NewsletterLink extends Model {
public static $_table = MP_NEWSLETTER_LINKS_TABLE;
function __construct() {
parent::__construct();
}
}

View File

@@ -3,8 +3,8 @@ namespace MailPoet\Models;
if(!defined('ABSPATH')) exit;
class NewsletterStatistics extends Model {
public static $_table = MP_NEWSLETTER_STATISTICS_TABLE;
class StatisticsNewsletters extends Model {
public static $_table = MP_STATISTICS_NEWSLETTERS_TABLE;
function __construct() {
parent::__construct();
@@ -12,7 +12,7 @@ class NewsletterStatistics extends Model {
static function createMultiple($data) {
return self::rawExecute(
'INSERT INTO `' . NewsletterStatistics::$_table . '` ' .
'INSERT INTO `' . self::$_table . '` ' .
'(newsletter_id, subscriber_id, queue_id) ' .
'VALUES ' . rtrim(
str_repeat('(?,?,?), ', count($data)/3),

View File

@@ -0,0 +1,24 @@
<?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) {
return self::rawExecute(
'INSERT INTO `' . self::$_table . '` ' .
'(newsletter_id, subscriber_id, queue_id) ' .
'VALUES ' . rtrim(
str_repeat('(?,?,?), ', count($data)/3),
', '
),
$data
);
}
}