Remove an excess count() [MAILPOET-833]

This commit is contained in:
Alexey Stoletniy
2017-02-23 23:42:18 +03:00
parent 384d59abe0
commit 16724affad

View File

@@ -75,18 +75,15 @@ class Newsletters extends APIEndpoint {
$newsletter->type $newsletter->type
)->findMany(); )->findMany();
if(count($option_fields)) { foreach($option_fields as $option_field) {
if(isset($options[$option_field->name])) {
foreach($option_fields as $option_field) { $newsletter_option = NewsletterOption::createOrUpdate(
if(isset($options[$option_field->name])) { array(
$newsletter_option = NewsletterOption::createOrUpdate( 'newsletter_id' => $newsletter->id,
array( 'option_field_id' => $option_field->id,
'newsletter_id' => $newsletter->id, 'value' => $options[$option_field->name]
'option_field_id' => $option_field->id, )
'value' => $options[$option_field->name] );
)
);
}
} }
} }
} }