How Bag Works
Bag works by utilizing pipelines to process the input and output data.
There are four pipelines:
InputPipelinefor handling input and constructing the Bag objectValidationPipelinefor validating without constructing the Bag objectOutputPipelinefor handling outputOutputCollectionPipelinefor handling collection output
Each pipeline is detailed below.
TIP
Each stage in the diagrams below is linked to the relevant source code for that stage.
The Input Pipeline
The InputPipeline is responsible for processing the input data so that the Bag object can be created. The pipeline consists of the following steps:
The Output Pipeline
The OutputPipeline is responsible transforming the Bag data to the desired output array or JSON. The pipeline consists of the following steps:
NOTE
* These steps are only performed if the Bag is being converted to an array and/or JSON.
The Validation Pipeline
The ValidationPipeline is responsible for validating the input data without constructing the Bag object. The pipeline consists of the following steps:
The Without Validate Pipeline
The WithoutValidationPipeline is identical to the InputPipeline but does not perform validation. The pipeline consists of the following steps:
The Output Collection Pipeline
The OutputCollectionPipeline is responsible for transforming the Bag collection data to the desired output array or JSON. The pipeline consists of the following steps:
NOTE
* This step is only performed if the Bag is being converted to an array and/or JSON.