You are here

public function EckEntityBundleForm::exists in Entity Construction Kit (ECK) 8

Checks for an existing ECK bundle.

Parameters

string $type: The bundle type.

array $element: The form element.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Return value

bool TRUE if this bundle already exists in the entity type, FALSE otherwise.

File

src/Form/EntityBundle/EckEntityBundleForm.php, line 277

Class

EckEntityBundleForm
Form controller for ECK entity bundle forms.

Namespace

Drupal\eck\Form\EntityBundle

Code

public function exists($type, array $element, FormStateInterface $form_state) {
  $bundleStorage = \Drupal::entityTypeManager()
    ->getStorage($this->entity
    ->getEckEntityTypeMachineName() . '_type');
  return (bool) $bundleStorage
    ->load($type);
}