function RulesComponentFormBase::exists

Machine name exists callback.

Parameters

string $id: The machine name ID.

Return value

bool TRUE if an entity with the same name already exists, FALSE otherwise.

File

src/Form/RulesComponentFormBase.php, line 124

Class

RulesComponentFormBase
Provides the base form for rules add and edit forms.

Namespace

Drupal\rules\Form

Code

public function exists($id) {
    $type = $this->entity
        ->getEntityTypeId();
    return (bool) $this->entityTypeManager
        ->getStorage($type)
        ->load($id);
}