Fixed issue #4

This commit is contained in:
Francis Besset
2011-08-11 00:59:40 +02:00
parent b0efd027d5
commit 838e16b1c4
2 changed files with 12 additions and 2 deletions

View File

@ -28,8 +28,7 @@ class Collection implements \IteratorAggregate, \Countable
throw new \InvalidArgumentException(sprintf('Cannot add class "%s" because it is not an instance of "%s"', get_class($element), $this->class));
}
$getter = $this->getter;
$this->elements[$element->$getter()] = $element;
$this->elements[$element->{$this->getter}()] = $element;
}
public function addAll($elements)