Пример #1
1
 function current()
 {
     $current = $this->_iterator->current();
     return $this->_pipe->process($current);
 }
Пример #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();
 }
Пример #4
0
 /**
  * Adds a new stage to the outbound pipeline.
  *
  * @param   \League\Pipeline\StageInterface  $stage
  */
 public function addOutboundPipelineStage(StageInterface $stage)
 {
     $this->outboundPipeline = $this->outboundPipeline->pipe($stage);
 }
Пример #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);
 }
Пример #6
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $this->pipeline->process($this->data);
 }