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
)->findMany();
if(count($option_fields)) {
foreach($option_fields as $option_field) {
if(isset($options[$option_field->name])) {
$newsletter_option = NewsletterOption::createOrUpdate(
array(
'newsletter_id' => $newsletter->id,
'option_field_id' => $option_field->id,
'value' => $options[$option_field->name]
)
);
}
foreach($option_fields as $option_field) {
if(isset($options[$option_field->name])) {
$newsletter_option = NewsletterOption::createOrUpdate(
array(
'newsletter_id' => $newsletter->id,
'option_field_id' => $option_field->id,
'value' => $options[$option_field->name]
)
);
}
}
}