You are here

public function ArrayCollection::contains in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php \Doctrine\Common\Collections\ArrayCollection::contains()

Checks whether an element is contained in the collection. This is an O(n) operation, where n is the size of the collection.

Parameters

mixed $element The element to search for.:

Return value

boolean TRUE if the collection contains the element, FALSE otherwise.

Overrides Collection::contains

File

vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php, line 187

Class

ArrayCollection
An ArrayCollection is a Collection implementation that wraps a regular PHP array.

Namespace

Doctrine\Common\Collections

Code

public function contains($element) {
  return in_array($element, $this->elements, true);
}