Example #1
1
 function current()
 {
     $current = $this->_iterator->current();
     return $this->_pipe->process($current);
 }
Example #2
0
 /**
  * @return Item|mixed
  */
 function current()
 {
     $current = $this->_result->current();
     if (is_array($current)) {
         $current = (new Item($this->_collection))->setData($current);
     }
     return $this->_pipe->process($current);
 }
 /**
  * Constructor.
  *
  * @param StageInterface[] $stages
  *
  * @throws InvalidArgumentException
  */
 public function __construct(array $stages = [])
 {
     parent::__construct($stages);
     // could DI in the Builder
     $this->callbackFactory = new ConditionCallbackFactory();
     $this->accessor = new Accessor();
     $this->expression = new ExpressionBuilder();
 }
 /**
  * Adds a new stage to the outbound pipeline.
  *
  * @param   \League\Pipeline\StageInterface  $stage
  */
 public function addOutboundPipelineStage(StageInterface $stage)
 {
     $this->outboundPipeline = $this->outboundPipeline->pipe($stage);
 }
Example #5
0
 /**
  * @param Payload $payload
  *
  * @return Payload
  */
 public function process($payload)
 {
     $this->builder->add(new IncludedResource())->add(new RequestedFields())->add(new PagedPagination())->add(new OffsetLimitPagination())->add(new CursorBasedPagination())->add(new Sorts());
     $this->pipeline = $this->builder->build();
     return $this->pipeline->process($payload);
 }
Example #6
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $this->pipeline->process($this->data);
 }