You are here

protected function InlineEntityFormBase::canAddNew in Inline Entity Form 8

Determines if the current user can add any new entities.

Return value

bool

1 call to InlineEntityFormBase::canAddNew()
InlineEntityFormSimple::formMultipleElements in src/Plugin/Field/FieldWidget/InlineEntityFormSimple.php
Special handling to create form elements for multiple values.

File

src/Plugin/Field/FieldWidget/InlineEntityFormBase.php, line 594

Class

InlineEntityFormBase
Inline entity form widget base class.

Namespace

Drupal\inline_entity_form\Plugin\Field\FieldWidget

Code

protected function canAddNew() {
  $create_bundles = $this
    ->getCreateBundles();
  return !empty($create_bundles);
}