Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AbstractSet.php

function AbstractSet::add

Overrides AbstractCollection::add

File

vendor/ramsey/collection/src/AbstractSet.php, line 27

Class

AbstractSet
This class contains the basic implementation of a collection that does not allow duplicated values (a set), to minimize the effort required to implement this specific type of collection.

Namespace

Ramsey\Collection

Code

public function add(mixed $element) : bool {
    if ($this->contains($element)) {
        return false;
    }
    return parent::add($element);
}
RSS feed
Powered by Drupal