You are here

protected function NodeField::getNodeTypes in Entity Field Condition 8

Return the node types.

Return value

array Returns the available node types.

1 call to NodeField::getNodeTypes()
NodeField::buildConfigurationForm in src/Plugin/Condition/NodeField.php
Form constructor.

File

src/Plugin/Condition/NodeField.php, line 149

Class

NodeField
Provides a 'Node Field' condition.

Namespace

Drupal\entity_field_condition\Plugin\Condition

Code

protected function getNodeTypes() {

  // Get all the Node types.
  $node_types = $this->entityTypeManager
    ->getStorage('node_type')
    ->loadMultiple();

  // Options for node types.
  $node_type_options = $this
    ->getEmptyOption();
  foreach ($node_types as $node_type) {

    // Adding the nodes types.
    $node_type_options[$node_type
      ->id()] = $node_type
      ->label();
  }
  return $node_type_options;
}