Methods |
public
|
__construct(?ContainerInterface $container = null)
Creates a new Pipeline object
Creates a new Pipeline object
|
#
|
public
static
|
create(?ContainerInterface $container = null): PipelineInterface<mixed, mixed, mixed>
Creates a new Pipeline object
Creates a new Pipeline object
|
#
|
public
|
send($payload, $arg = null)
Pass a payload to the pipeline
Pass a payload to the pipeline
Call {@see EntityPipelineInterface::run()} to run the pipeline and get
the result.
Implements
|
#
|
public
|
stream(iterable $payload, $arg = null)
Pass a list of payloads to the pipeline
Pass a list of payloads to the pipeline
Call {@see StreamPipelineInterface::start()} to run the pipeline with
each value in $payload and get the results via a generator.
Implements
|
#
|
public
|
withConformity($conformity)
Set the payload's array key conformity
Set the payload's array key conformity
$conformity is passed to any array key mappers added to the pipeline
with {@see BasePipelineInterface::throughKeyMap()}. It has no effect
otherwise.
Parameters
$conformity |
Use {@see ListConformity::COMPLETE}
wherever possible to improve performance.
|
Implements
|
#
|
public
|
getConformity()
Get the payload's array key conformity
Get the payload's array key conformity
Implements
|
#
|
public
|
after(Closure $closure)
Apply a closure to each payload before it is sent
Apply a closure to each payload before it is sent
This method can only be called once per pipeline.
Implements
|
#
|
public
|
afterIf(Closure $closure)
Apply a closure to each payload before it is sent if after() hasn't
already been called
Apply a closure to each payload before it is sent if after() hasn't
already been called
Implements
|
#
|
public
|
through($pipe)
Add a pipe to the pipeline
Add a pipe to the pipeline
A pipe must be one of the following:
- an instance of a class that implements {@see PipeInterface}
- the name of a class that implements {@see PipeInterface}
- a closure
Whichever form it takes, a pipe should do something with $payload
before taking one of the following actions:
- return the value of
$next($payload)
- return a value that will be discarded by
{@see StreamPipelineInterface::unless()}, bypassing any remaining pipes
and {@see BasePipelineInterface::then()}, if applicable
- throw an exception
Implements
|
#
|
public
|
throughClosure(Closure $closure)
Add a simple closure to the pipeline
Add a simple closure to the pipeline
Implements
|
#
|
public
|
throughKeyMap(array $keyMap, int $flags = ArrayMapper::ADD_UNMAPPED)
Add an array key mapper to the pipeline
Add an array key mapper to the pipeline
Parameters
$keyMap |
An array that maps
input keys to one or more output keys.
|
Implements
|
#
|
public
|
then(Closure $closure)
Apply a closure to each result
Apply a closure to each result
This method can only be called once per pipeline, and only if
{@see StreamPipelineInterface::collectThen()} is not also called.
Implements
|
#
|
public
|
thenIf(Closure $closure)
Apply a closure to each result if then() hasn't already been called
Apply a closure to each result if then() hasn't already been called
Implements
|
#
|
public
|
collectThen(Closure $closure)
Pass results to a closure in batches
Pass results to a closure in batches
{@see StreamPipelineInterface::collectThen()} can only be called once per
pipeline, and only if {@see BasePipelineInterface::then()} is not also
called.
Values returned by the closure are returned to the caller via a
forward-only iterator.
Implements
|
#
|
public
|
collectThenIf(Closure $closure)
Pass results to a closure in batches if collectThen() hasn't already been
called
Pass results to a closure in batches if collectThen() hasn't already been
called
Implements
|
#
|
public
|
cc(Closure $closure)
Pass each result to a closure
Pass each result to a closure
Results not discarded by {@see StreamPipelineInterface::unless()} are
passed to the closure before leaving the pipeline. The closure's return
value is ignored.
Implements
|
#
|
public
|
unless(Closure $filter)
Apply a filter to each result
Apply a filter to each result
{@see StreamPipelineInterface::unless()} can only be called once per
pipeline.
If $filter returns false , $result is returned to the caller,
otherwise it is discarded.
Implements
|
#
|
public
|
unlessIf(Closure $filter)
Apply a filter to each result if unless() hasn't already been called
Apply a filter to each result if unless() hasn't already been called
Implements
|
#
|
public
|
run()
Run the pipeline and return the result
Run the pipeline and return the result
Implements
|
#
|
public
|
runInto(PipelineInterface $next)
Run the pipeline and pass the result to another pipeline
Run the pipeline and pass the result to another pipeline
Implements
|
#
|
public
|
start(): Generator
Run the pipeline with each of the payload's values and return the results
via a forward-only iterator
Run the pipeline with each of the payload's values and return the results
via a forward-only iterator
Implements
|
#
|
public
|
startInto(PipelineInterface $next)
Run the pipeline and pass each result to another pipeline
Run the pipeline and pass each result to another pipeline
Implements
|
#
|