DateFormatFormBase::exists

public DateFormatFormBase::exists($entity_id, array $element)

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

core/modules/system/src/Form/DateFormatFormBase.php, line 68

Class

DateFormatFormBase
Provides a base form for date formats.

Namespace

Drupal\system\Form

Code

public function exists($entity_id, array $element) {
  return (bool) $this->dateFormatStorage
    ->getQuery()
    ->condition('id', $element['#field_prefix'] . $entity_id)
    ->execute();
}
doc_Drupal
2016-10-29 09:00:38
Comments
Leave a Comment

Please login to continue.