You are here

public function ImageCaptionStorage::isCaption in Image Field Caption 8

Check if a caption is already defined for the specified arguments.

Parameters

string $entity_type: The entity type, like 'node' or 'comment'.

string $bundle: The bundle, like 'article' or 'news'.

string $field_name: The field name of the image field, like 'field_image' or 'field_article_image'.

int $entity_id: The entity id.

int $revision_id: The revision id.

string $language: The language key, like 'en' or 'fr'.

int $delta: The delta of the image field.

Return value

bool TRUE if a caption exists or FALSE if not.

File

src/ImageCaptionStorage.php, line 98
Contains \Drupal\image_field_caption\ImageCaptionStorage.

Class

ImageCaptionStorage
Storage controller class for image captions.

Namespace

Drupal\image_field_caption

Code

public function isCaption($entity_type, $bundle, $field_name, $entity_id, $revision_id, $language, $delta) {
  return !empty(self::getCaption($entity_type, $bundle, $field_name, $entity_id, $revision_id, $language, $delta)) ? TRUE : FALSE;
}