/**
  * {@inheritdoc}
  */
 protected function handleProcedure(Procedure $procedure)
 {
     $response = $this->handleSources($procedure->getSources());
     while ($object = $this->nextObject($response)) {
         $this->stack->getScope('global')->add($object);
         $this->handleWorkers($procedure->getWorkers(), $object, $this->stack->getScope('global'));
     }
     $this->handleTargets($procedure->getTargets(), new Request($this->stack->getScope('global')->all()));
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 protected function handleProcedure(Procedure $procedure)
 {
     foreach ((array) $procedure->getSources() as $source) {
         list($adapter, $request) = $source;
         $response = $this->handleSource($adapter, $request);
         while ($object = $this->nextObject($response->getData())) {
             $storage = $this->prepareLocalStorage($object);
             $this->handleWorkers($procedure->getWorkers(), $object, $storage);
             $this->handleTargets($procedure->getTargets(), new Request($storage->all()));
             $this->mergeStorage($storage);
         }
     }
 }
Example #3
0
 /**
  * Describes a procedure.
  *
  * @param Procedure       $procedure Procedure
  * @param OutputInterface $output    Console output handle
  * @param int             $depth     Current depth
  */
 private function describeProcedure(Procedure $procedure, OutputInterface $output, $depth = 0)
 {
     $output->writeln(sprintf('%sProcedure <info>%s</info>', str_repeat(' ', $depth), $procedure->getName()));
     $this->describeComponents($procedure->getSources(), 'SOURCES', $output, $depth);
     $this->describeComponents($procedure->getWorkers(), 'WORKERS', $output, $depth);
     $this->describeComponents($procedure->getTargets(), 'TARGETS', $output, $depth);
     $this->describeChildProcedures($procedure->getChildren(), $output, $depth);
     $output->write("\n");
 }
Example #4
0
 /**
  * Builds a procedure object.
  *
  * @return Procedure
  */
 public function getProcedure()
 {
     return Procedure::createFromDefinition($this->definitions['root']);
 }