Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BundleConstraint.php

function BundleConstraint::getBundleOption

Gets the bundle option as array.

Return value

array

File

core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/BundleConstraint.php, line 41

Class

BundleConstraint
Checks if a value is a valid entity type.

Namespace

Drupal\Core\Entity\Plugin\Validation\Constraint

Code

public function getBundleOption() {
    // Support passing the bundle as string, but force it to be an array.
    if (!is_array($this->bundle)) {
        $this->bundle = [
            $this->bundle,
        ];
    }
    return $this->bundle;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal