示例#1
0
 /**
  * Process integration synchronization
  * By default, if $connector is empty, will process all connectors of given integration
  *
  * @param Integration $integration Integration object
  * @param array       $parameters  Connector additional parameters
  * @param callable    $callback    Callback to filter connectors
  *
  * @return boolean
  */
 protected function processConnectors(Integration $integration, array $parameters = [], callable $callback = null)
 {
     $isSuccess = true;
     $connectors = $integration->getConnectors();
     if ($callback) {
         $connectors = array_filter($connectors, $callback);
     }
     foreach ((array) $connectors as $connector) {
         try {
             $result = $this->processIntegrationConnector($integration, $connector, $parameters);
             $isSuccess = $isSuccess && $result;
         } catch (\Exception $e) {
             $isSuccess = false;
             $this->logger->critical($e->getMessage());
         }
     }
     return $isSuccess;
 }