You are here

public function Collection::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.

2 methods override Collection::contains()
AbstractLazyCollection::contains in lib/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php
Checks whether an element is contained in the collection. This is an O(n) operation, where n is the size of the collection.
ArrayCollection::contains in lib/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php
Checks whether an element is contained in the collection. This is an O(n) operation, where n is the size of the collection.

File

lib/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php, line 75

Class

Collection
The missing (SPL) Collection/Array/OrderedMap interface.

Namespace

Doctrine\Common\Collections

Code

public function contains($element);