src/Data/DefaultCollection.php
public function union($collection)
    {
        $union = clone $this;

        /** @var ModelInterface $otherModel */
        foreach ($collection->diff($this) as $otherModel) {
            $union->push($otherModel);
        }

        return $union;
    }
public function union($collection)
    {
        $union = clone $this;

        /** @var ModelInterface $otherModel */
        foreach ($collection->diff($this) as $otherModel) {
            $union->push($otherModel);
        }

        return $union;
    }
public function union ( $ collection ) { $ union = clone $ this ; /** @var ModelInterface $otherModel */ foreach ( $ collection -> diff ( $ this ) as $ otherModel ) { $ union -> push ( $ otherModel ) ; } return $ union ; }
Compute the union of this collection and the given collection.

@param CollectionInterface $collection The collection to intersect.

@return CollectionInterface
Compute the union of this collection and the given collection .