FOF30\Utils\Collection::merge PHP Метод

merge() публичный Метод

Merge the collection with the given items.
public merge ( Collection | array $items ) : Collection
$items Collection | array
Результат Collection
    public function merge($items)
    {
        return new static(array_merge($this->items, $this->getArrayableItems($items)));
    }

Usage Example

Пример #1
0
 public function testMergeCollection()
 {
     $c = new Collection(array('name' => 'Hello'));
     $this->assertEquals(array('name' => 'World', 'id' => 1), $c->merge(new Collection(array('name' => 'World', 'id' => 1)))->all());
 }