You are here

public function SubscriptionsFormBase::setNewsletterIds in Simplenews 8.2

Same name and namespace in other branches
  1. 8 src/Form/SubscriptionsFormBase.php \Drupal\simplenews\Form\SubscriptionsFormBase::setNewsletterIds()
  2. 3.x src/Form/SubscriptionsFormBase.php \Drupal\simplenews\Form\SubscriptionsFormBase::setNewsletterIds()

Set the newsletters available to select from.

Unless called otherwise, all newsletters will be available.

Parameters

string[] $newsletters: An array of Newsletter IDs.

1 call to SubscriptionsFormBase::setNewsletterIds()
SubscriptionsFormBase::getNewsletters in src/Form/SubscriptionsFormBase.php
Returns the newsletters available to select from.

File

src/Form/SubscriptionsFormBase.php, line 59

Class

SubscriptionsFormBase
Entity form for Subscriber with common routines.

Namespace

Drupal\simplenews\Form

Code

public function setNewsletterIds(array $newsletters) {
  $this->newsletters = Newsletter::loadMultiple($newsletters);
}