public function ArrayCollection::set

Adds/sets an element in the collection at the index / with the specified key.

When the collection is a Map this is like put(key,value)/add(key,value). When the collection is a List this is like add(position,value).

Parameters

mixed $key:

mixed $value:

Overrides Collection::set

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

File

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

Class

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

Namespace

Doctrine\Common\Collections

Code

public function set($key, $value) {
  $this->_elements[$key] = $value;
}