You are here

public function ArrayCollection::containsKey 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::containsKey()

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 vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php
Required by interface ArrayAccess.

File

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