You are here

public function NodeScheduler::getTypes in Scheduler 2.x

Get the available types/bundles for the entity type.

Do not use static or drupal_static here, because changes to third-party settings invalidate the saved values during phpunit testing.

Return value

array The node type objects, keyed by node type name.

Overrides SchedulerPluginBase::getTypes

1 call to NodeScheduler::getTypes()
NodeScheduler::entityFormIds in src/Plugin/Scheduler/NodeScheduler.php
Get the form IDs for node add/edit forms.

File

src/Plugin/Scheduler/NodeScheduler.php, line 35

Class

NodeScheduler
Plugin for Node entity type.

Namespace

Drupal\scheduler\Plugin\Scheduler

Code

public function getTypes() {
  $nodeTypes = \Drupal::entityTypeManager()
    ->getStorage('node_type')
    ->loadMultiple();
  return $nodeTypes;
}