You are here

protected function MediaTypeForm::getWorkflowOptions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/src/MediaTypeForm.php \Drupal\media\MediaTypeForm::getWorkflowOptions()
  2. 9 core/modules/media/src/MediaTypeForm.php \Drupal\media\MediaTypeForm::getWorkflowOptions()

Prepares workflow options to be used in the 'checkboxes' form element.

Return value

array Array of options ready to be used in #options.

1 call to MediaTypeForm::getWorkflowOptions()
MediaTypeForm::form in core/modules/media/src/MediaTypeForm.php
Gets the actual form array to be built.

File

core/modules/media/src/MediaTypeForm.php, line 251

Class

MediaTypeForm
Form controller for media type forms.

Namespace

Drupal\media

Code

protected function getWorkflowOptions() {
  $workflow_options = [
    'status' => $this->entity
      ->getStatus(),
    'new_revision' => $this->entity
      ->shouldCreateNewRevision(),
    'queue_thumbnail_downloads' => $this->entity
      ->thumbnailDownloadsAreQueued(),
  ];

  // Prepare workflow options to be used for 'checkboxes' form element.
  $keys = array_keys(array_filter($workflow_options));
  return array_combine($keys, $keys);
}