You are here

public function ArrayCollection::contains in Plug 7

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

lib/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);
}