/**
  * @param InputSeenEvent $event
  */
 public function onInputSeen(InputSeenEvent $event)
 {
     $inputStatus = $event->getInputStatus();
     $input = InputQuery::create()->findOneByUuid($inputStatus->uuid);
     // This should definitely never happen
     if ($input === null) {
         return;
     }
     if (!$this->_inputErrorCollection->contains($input)) {
         $this->_inputErrorCollection->attach($input, new InputErrorCumulative());
     }
     /* @var InputErrorCumulative $inputErrors */
     $inputErrors = $this->_inputErrorCollection[$input];
     $inputErrors->accumulate($inputStatus);
 }
 /**
  * @param InputSeenEvent $event
  */
 public function onInputSeen(InputSeenEvent $event)
 {
     $instanceName = $event->getInstance();
     $inputStatus = $event->getInputStatus();
     // Update the input and started fields for existing inputs
     if (InputQuery::create()->hasInput($inputStatus->uuid)) {
         $input = InputQuery::create()->findPk($inputStatus->uuid);
         $input->setStarted(new \DateTime())->setWeight($inputStatus->weight);
         return;
     }
     $input = new Input();
     $input->setInstanceName($instanceName)->setStarted(new \DateTime())->setFromInputStatus($inputStatus)->save();
     $this->logger->info('Stored new input (instance: {instanceName}, network: {network}, mux: {mux}, weight: {weight})', ['instanceName' => $instanceName, 'network' => $input->getNetwork(), 'mux' => $input->getMux(), 'weight' => $input->getWeight()]);
 }