Updates method data verification condition

This commit is contained in:
Vlad
2017-02-23 14:39:56 -05:00
parent a1cd56c419
commit 027414b7a2

View File

@@ -7,7 +7,7 @@ class NewsletterOption extends Model {
public static $_table = MP_NEWSLETTER_OPTION_TABLE; public static $_table = MP_NEWSLETTER_OPTION_TABLE;
static function createOrUpdate($data = array()) { static function createOrUpdate($data = array()) {
if(!is_array($data) && empty($data)) return; if(!is_array($data) || empty($data['newsletter_id']) || empty($data['option_field_id'])) return;
$newsletter_option = self::where('option_field_id', $data['option_field_id']) $newsletter_option = self::where('option_field_id', $data['option_field_id'])
->where('newsletter_id', $data['newsletter_id']) ->where('newsletter_id', $data['newsletter_id'])