You are here

private function ScheduledPublishCron::getScheduledFields in Scheduled Publish 8

Same name and namespace in other branches
  1. 8.3 src/Service/ScheduledPublishCron.php \Drupal\scheduled_publish\Service\ScheduledPublishCron::getScheduledFields()
  2. 8.2 src/Service/ScheduledPublishCron.php \Drupal\scheduled_publish\Service\ScheduledPublishCron::getScheduledFields()
1 call to ScheduledPublishCron::getScheduledFields()
ScheduledPublishCron::doUpdate in src/Service/ScheduledPublishCron.php

File

src/Service/ScheduledPublishCron.php, line 69

Class

ScheduledPublishCron
Class ScheduledPublishCron

Namespace

Drupal\scheduled_publish\Service

Code

private function getScheduledFields(string $bundleName) : array {
  $scheduledFields = [];
  $fields = $this->entityFieldManager
    ->getFieldDefinitions('node', $bundleName);
  foreach ($fields as $fieldName => $field) {

    /** @var FieldConfig $field */
    if (strpos($fieldName, 'field_') !== FALSE) {
      if ($field
        ->getType() === 'scheduled_publish') {
        $scheduledFields[] = $fieldName;
      }
    }
  }
  return $scheduledFields;
}