/**
  * Exclude object from result
  *
  * @param   ChildInput $input Object to remove from the list of results
  *
  * @return $this|ChildInputQuery The current query, for fluid interface
  */
 public function prune($input = null)
 {
     if ($input) {
         $this->addUsingAlias(InputTableMap::COL_UUID, $input->getUuid(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aInput) {
         $this->aInput->removeInputError($this);
     }
     $this->id = null;
     $this->input_uuid = null;
     $this->ber_average = null;
     $this->unc_average = null;
     $this->cumulative_te = null;
     $this->cumulative_cc = null;
     $this->created = null;
     $this->modified = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aInstance) {
         $this->aInstance->removeSubscription($this);
     }
     if (null !== $this->aInput) {
         $this->aInput->removeSubscription($this);
     }
     if (null !== $this->aUser) {
         $this->aUser->removeSubscription($this);
     }
     if (null !== $this->aChannel) {
         $this->aChannel->removeSubscription($this);
     }
     $this->id = null;
     $this->instance_name = null;
     $this->input_uuid = null;
     $this->user_id = null;
     $this->channel_id = null;
     $this->subscription_id = null;
     $this->started = null;
     $this->stopped = null;
     $this->title = null;
     $this->service = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
 /**
  * Filter the query by a related \Jalle19\StatusManager\Database\Input object
  *
  * @param \Jalle19\StatusManager\Database\Input|ObjectCollection $input the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildInstanceQuery The current query, for fluid interface
  */
 public function filterByInput($input, $comparison = null)
 {
     if ($input instanceof \Jalle19\StatusManager\Database\Input) {
         return $this->addUsingAlias(InstanceTableMap::COL_NAME, $input->getInstanceName(), $comparison);
     } elseif ($input instanceof ObjectCollection) {
         return $this->useInputQuery()->filterByPrimaryKeys($input->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByInput() only accepts arguments of type \\Jalle19\\StatusManager\\Database\\Input or Collection');
     }
 }
 /**
  * Filter the query by a related \Jalle19\StatusManager\Database\Input object
  *
  * @param \Jalle19\StatusManager\Database\Input|ObjectCollection $input The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildSubscriptionQuery The current query, for fluid interface
  */
 public function filterByInput($input, $comparison = null)
 {
     if ($input instanceof \Jalle19\StatusManager\Database\Input) {
         return $this->addUsingAlias(SubscriptionTableMap::COL_INPUT_UUID, $input->getUuid(), $comparison);
     } elseif ($input instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(SubscriptionTableMap::COL_INPUT_UUID, $input->toKeyValue('PrimaryKey', 'Uuid'), $comparison);
     } else {
         throw new PropelException('filterByInput() only accepts arguments of type \\Jalle19\\StatusManager\\Database\\Input or Collection');
     }
 }
 /**
  * @param ChildInput $input The ChildInput object to add.
  */
 protected function doAddInput(ChildInput $input)
 {
     $this->collInputs[] = $input;
     $input->setInstance($this);
 }
 /**
  * @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()]);
 }