/**
  * Exclude object from result
  *
  * @param   ChildChannel $channel Object to remove from the list of results
  *
  * @return $this|ChildChannelQuery The current query, for fluid interface
  */
 public function prune($channel = null)
 {
     if ($channel) {
         $this->addUsingAlias(ChannelTableMap::COL_ID, $channel->getId(), 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->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\Channel object
  *
  * @param \Jalle19\StatusManager\Database\Channel|ObjectCollection $channel 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 filterByChannel($channel, $comparison = null)
 {
     if ($channel instanceof \Jalle19\StatusManager\Database\Channel) {
         return $this->addUsingAlias(InstanceTableMap::COL_NAME, $channel->getInstanceName(), $comparison);
     } elseif ($channel instanceof ObjectCollection) {
         return $this->useChannelQuery()->filterByPrimaryKeys($channel->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByChannel() only accepts arguments of type \\Jalle19\\StatusManager\\Database\\Channel or Collection');
     }
 }
 /**
  * Filter the query by a related \Jalle19\StatusManager\Database\Channel object
  *
  * @param \Jalle19\StatusManager\Database\Channel|ObjectCollection $channel 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 filterByChannel($channel, $comparison = null)
 {
     if ($channel instanceof \Jalle19\StatusManager\Database\Channel) {
         return $this->addUsingAlias(SubscriptionTableMap::COL_CHANNEL_ID, $channel->getId(), $comparison);
     } elseif ($channel instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(SubscriptionTableMap::COL_CHANNEL_ID, $channel->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByChannel() only accepts arguments of type \\Jalle19\\StatusManager\\Database\\Channel or Collection');
     }
 }
Пример #5
0
 /**
  * @param ChildChannel $channel The ChildChannel object to add.
  */
 protected function doAddChannel(ChildChannel $channel)
 {
     $this->collChannels[] = $channel;
     $channel->setInstance($this);
 }
 /**
  * @param string $instanceName
  * @param string $channelName
  *
  * @throws \Propel\Runtime\Exception\PropelException
  */
 private function onChannelSeen($instanceName, $channelName)
 {
     if (ChannelQuery::create()->hasChannel($instanceName, $channelName)) {
         return;
     }
     $channel = new Channel();
     $channel->setInstanceName($instanceName)->setName($channelName);
     $channel->save();
     $this->logger->info('Stored new channel (instance: {instanceName}, name: {channelName})', ['instanceName' => $instanceName, 'channelName' => $channelName]);
 }