You are here

public function ArrayCollection::containsKey in Plug 7

Checks whether the collection contains an element with the specified key/index.

Parameters

string|integer $key The key/index to check for.:

Return value

boolean TRUE if the collection contains an element with the specified key/index, FALSE otherwise.

Overrides Collection::containsKey

1 call to ArrayCollection::containsKey()
ArrayCollection::offsetExists in lib/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php
Required by interface ArrayAccess.

File

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

Class

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

Namespace

Doctrine\Common\Collections

Code

public function containsKey($key) {
  return isset($this->elements[$key]) || array_key_exists($key, $this->elements);
}