Upgrade to 3.0.2

This commit is contained in:
Bastian Allgeier
2019-02-19 16:39:58 +01:00
parent f76ee1bb14
commit 8e3d86a590
44 changed files with 638 additions and 264 deletions

View File

@@ -73,7 +73,7 @@ class Collection extends BaseCollection
*/
public function __set(string $id, $object)
{
$this->data[$object->id()] = $object;
$this->data[$id] = $object;
}
/**
@@ -81,14 +81,16 @@ class Collection extends BaseCollection
* an entire second collection to the
* current collection
*
* @param mixed $item
* @param mixed $object
*/
public function add($object)
{
if (is_a($object, static::class) === true) {
$this->data = array_merge($this->data, $object->data);
} else {
} elseif (method_exists($object, 'id') === true) {
$this->__set($object->id(), $object);
} else {
$this->append($object);
}
return $this;