You are here

public function ContentService::getFollowingContent in Content Planner 8

File

modules/content_calendar/src/ContentService.php, line 59

Class

ContentService
Class UserProfileImage.

Namespace

Drupal\content_calendar

Code

public function getFollowingContent($limit) {
  $configs = $this
    ->getContentTypeConfig();
  $types = [];
  if (is_array($configs)) {
    foreach ($configs as $config) {
      $types[] = $config
        ->getOriginalId();
    }
  }
  if (empty($types)) {
    return [];
  }
  $ids = \Drupal::entityQuery('node')
    ->condition('status', 0)
    ->condition('type', $types, 'IN')
    ->condition('publish_on', NULL, 'IS NOT NULL')
    ->sort('publish_on', 'ASC')
    ->range(0, $limit)
    ->execute();
  return $nodes = Node::loadMultiple($ids);
}