Updates method data verification condition
This commit is contained in:
@@ -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'])
|
||||||
|
Reference in New Issue
Block a user