You are here

public function SmartDateFormatForm::exists in Smart Date 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Form/SmartDateFormatForm.php \Drupal\smart_date\Form\SmartDateFormatForm::exists()
  2. 8 src/Form/SmartDateFormatForm.php \Drupal\smart_date\Form\SmartDateFormatForm::exists()
  3. 3.x src/Form/SmartDateFormatForm.php \Drupal\smart_date\Form\SmartDateFormatForm::exists()
  4. 3.1.x src/Form/SmartDateFormatForm.php \Drupal\smart_date\Form\SmartDateFormatForm::exists()
  5. 3.2.x src/Form/SmartDateFormatForm.php \Drupal\smart_date\Form\SmartDateFormatForm::exists()
  6. 3.3.x src/Form/SmartDateFormatForm.php \Drupal\smart_date\Form\SmartDateFormatForm::exists()
  7. 3.4.x src/Form/SmartDateFormatForm.php \Drupal\smart_date\Form\SmartDateFormatForm::exists()

Checks for an existing date format.

Parameters

string|int $entity_id: The entity ID.

array $element: The form element.

Return value

bool TRUE if this format already exists, FALSE otherwise.

File

src/Form/SmartDateFormatForm.php, line 67

Class

SmartDateFormatForm
Form controller for smart date format edit forms.

Namespace

Drupal\smart_date\Form

Code

public function exists($entity_id, array $element) {
  return (bool) $this->smartDateFormatStorage
    ->load($entity_id);
}