function CommentFieldItemList::offsetExists

Same name in other branches
  1. 9 core/modules/comment/src/CommentFieldItemList.php \Drupal\comment\CommentFieldItemList::offsetExists()
  2. 8.9.x core/modules/comment/src/CommentFieldItemList.php \Drupal\comment\CommentFieldItemList::offsetExists()
  3. 10 core/modules/comment/src/CommentFieldItemList.php \Drupal\comment\CommentFieldItemList::offsetExists()

Overrides ItemList::offsetExists

File

core/modules/comment/src/CommentFieldItemList.php, line 33

Class

CommentFieldItemList
Defines an item list class for comment fields.

Namespace

Drupal\comment

Code

public function offsetExists($offset) : bool {
    // For consistency with what happens in get(), we force offsetExists() to
    // be TRUE for delta 0.
    if ($offset === 0) {
        return TRUE;
    }
    return parent::offsetExists($offset);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.