Files
piratepoet/lib/Models/NewsletterOption.php
Amine Ben hammou b076e03a75 using static instead of self
renaming `internalCreateOrUpdate` to `_createOrUpdate`
renaming `$conditions` to `$keys`
adding block comment for `_createOrUpdate` method.
2018-02-12 11:15:46 +00:00

19 lines
490 B
PHP

<?php
namespace MailPoet\Models;
if(!defined('ABSPATH')) exit;
class NewsletterOption extends Model {
public static $_table = MP_NEWSLETTER_OPTION_TABLE;
static function createOrUpdate($data = array()) {
if(!is_array($data) || empty($data['newsletter_id']) || empty($data['option_field_id'])) {
return;
}
return parent::_createOrUpdate($data, array(
'option_field_id' => $data['option_field_id'],
'newsletter_id' => $data['newsletter_id']
));
}
}