public function ArrayCollection::get

Gets the element with the given key/index.

Parameters

mixed $key The key.:

Return value

mixed The element or NULL, if no element exists for the given key.

Overrides Collection::get

1 call to ArrayCollection::get()
ArrayCollection::offsetGet in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php
ArrayAccess implementation of offsetGet()

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php, line 277

Class

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

Namespace

Doctrine\Common\Collections

Code

public function get($key) {
  if (isset($this->_elements[$key])) {
    return $this->_elements[$key];
  }
  return null;
}