values()¶
Values operator iterates over given stream of iterables and yields only list of values.
- class RunOpenCode\Component\Dataset\Operator\Values¶
- __construct(iterable<TKey, TValue> $source)¶
- Parameters:
$source –
iterable<TKey, TValue>Stream of items to iterate over.
- getIterator()¶
- Returns:
\Traversable<int, TKey>Stream of values.
Use cases¶
Use this operator to get only values of a dataset.
Example¶
1<?php
2
3use RunOpenCode\Component\Dataset\Stream;
4
5new Stream($dataset)
6 ->values(); // yields only values of the dataset, zero-based indexed.