You are here

public function MailchimpSignupForm::exist in Mailchimp 8

Same name and namespace in other branches
  1. 2.x modules/mailchimp_signup/src/Form/MailchimpSignupForm.php \Drupal\mailchimp_signup\Form\MailchimpSignupForm::exist()

Determines if a signup exists.

Parameters

string $id: The signup ID.

Return value

bool Whether or not the signup exists.

File

modules/mailchimp_signup/src/Form/MailchimpSignupForm.php, line 483

Class

MailchimpSignupForm
Form controller for the MailchimpSignup entity edit form.

Namespace

Drupal\mailchimp_signup\Form

Code

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