- Added new model "SubscriberList"
- Added has_many_through relations to the new model + Subscriber model - Added tests - Fixed syntax in other models This closes #95
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace MailPoet\Models;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
if(!defined('ABSPATH')) exit;
|
||||
|
||||
class Subscriber extends Model {
|
||||
public static $_table = MP_SUBSCRIBERS_TABLE;
|
||||
@ -14,4 +14,8 @@ class Subscriber extends Model {
|
||||
'isEmail' => __('Your email address is invalid.')
|
||||
));
|
||||
}
|
||||
|
||||
public function lists() {
|
||||
return self::has_many_through(__NAMESPACE__ . '\SubscriberList', __NAMESPACE__ . '\PivotSubscriberList', 'subscriber_id', 'list_id');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user