You are here

function simplenews_newsletter_get_all in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 simplenews.module \simplenews_newsletter_get_all()
  2. 8 simplenews.module \simplenews_newsletter_get_all()
  3. 7.2 simplenews.module \simplenews_newsletter_get_all()

Loads all newsletters.

Return value

array All newsletter entities.

Related topics

11 calls to simplenews_newsletter_get_all()
SimplenewsAdministrationTest::testNewsletterSettings in tests/src/Functional/SimplenewsAdministrationTest.php
Test various combinations of newsletter settings.
SimplenewsAdministrationTest::testSubscriberStatusFilter in tests/src/Functional/SimplenewsAdministrationTest.php
Test content subscription status filter in subscriber view.
SimplenewsAdministrationTest::testSubscriptionManagement in tests/src/Functional/SimplenewsAdministrationTest.php
Test newsletter subscription management.
SimplenewsSubscribeTest::testSubscribeMultiple in tests/src/Functional/SimplenewsSubscribeTest.php
Subscribe to multiple newsletters at the same time.
SimplenewsTestBase::getRandomNewsletter in tests/src/Functional/SimplenewsTestBase.php
Select randomly one of the available newsletters.

... See full list

File

./simplenews.module, line 642
Simplenews node handling, sent email, newsletter block and general hooks.

Code

function simplenews_newsletter_get_all() {
  $newsletters = Newsletter::loadMultiple();
  $entity_type = \Drupal::entityTypeManager()
    ->getDefinition('simplenews_newsletter');
  uasort($newsletters, [
    $entity_type
      ->getClass(),
    'sort',
  ]);
  return $newsletters;
}