You are here

public function FlowForm::exists in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Form/FlowForm.php \Drupal\cms_content_sync\Form\FlowForm::exists()
  2. 2.0.x src/Form/FlowForm.php \Drupal\cms_content_sync\Form\FlowForm::exists()

Check if the entity exists.

A helper function to check whether an Flow configuration entity exists.

Parameters

int $id: An ID of sync

Return value

bool Checking on exist an entity

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/Form/FlowForm.php, line 719

Class

FlowForm
Form handler for the Flow add and edit forms.

Namespace

Drupal\cms_content_sync\Form

Code

public function exists($id) {
  $entity = $this->entityTypeManager
    ->getStorage('cms_content_sync_flow')
    ->getQuery()
    ->condition('id', $id)
    ->execute();
  return (bool) $entity;
}