You are here

function simplenews_newsletter_get_all in Simplenews 8

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

Loads all newsletters.

Return value

array All newsletter entities.

Related topics

12 calls to simplenews_newsletter_get_all()
SimplenewsAdministrationTest::testNewsletterSettings in src/Tests/SimplenewsAdministrationTest.php
Test various combinations of newsletter settings.
SimplenewsAdministrationTest::testSubscriberStatusFilter in src/Tests/SimplenewsAdministrationTest.php
Test content subscription status filter in subscriber view.
SimplenewsAdministrationTest::testSubscriptionManagement in src/Tests/SimplenewsAdministrationTest.php
Test newsletter subscription management.
SimplenewsSubscribeTest::testSubscribeAnonymous in src/Tests/SimplenewsSubscribeTest.php
testSubscribeAnonymous
SimplenewsSubscribeTest::testSubscribeAuthenticated in src/Tests/SimplenewsSubscribeTest.php
testSubscribeAuthenticated

... See full list

File

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

Code

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