/** * @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()]); }