/** * Saves this notification to the database so it can be sent to the remote * system later. If a response could not be confirmed, the message remains * queued and will be resent with the system event cron until received. * * @param SystemEventInstance $system_event_instance * @return SystemEventInstanceMessage */ public function saveSystemEventNotification($system_event_instance) { $system_event_instance_message = new \SystemEventInstanceMessage(); $system_event_instance_message->setSystemEventInstance($system_event_instance); $system_event_instance_message->setSystemEventSubscription($this); $system_event_instance_message->save(); //try to sent the notification, mark as sent if successful. try { //this is handled by the cron now } catch (\Exception $e) { //do nothing; cron will try to resend any unset } return $system_event_instance_message; }
/** * Exclude object from result * * @param SystemEventInstanceMessage $systemEventInstanceMessage Object to remove from the list of results * * @return SystemEventInstanceMessageQuery The current query, for fluid interface */ public function prune($systemEventInstanceMessage = null) { if ($systemEventInstanceMessage) { $this->addUsingAlias(SystemEventInstanceMessagePeer::ID, $systemEventInstanceMessage->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * @param SystemEventInstanceMessage $systemEventInstanceMessage The systemEventInstanceMessage object to add. */ protected function doAddSystemEventInstanceMessage($systemEventInstanceMessage) { $this->collSystemEventInstanceMessages[] = $systemEventInstanceMessage; $systemEventInstanceMessage->setSystemEventInstance($this); }
/** * Filter the query by a related SystemEventInstanceMessage object * * @param SystemEventInstanceMessage|PropelObjectCollection $systemEventInstanceMessage the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return SystemEventInstanceQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterBySystemEventInstanceMessage($systemEventInstanceMessage, $comparison = null) { if ($systemEventInstanceMessage instanceof SystemEventInstanceMessage) { return $this->addUsingAlias(SystemEventInstancePeer::ID, $systemEventInstanceMessage->getSystemEventInstanceId(), $comparison); } elseif ($systemEventInstanceMessage instanceof PropelObjectCollection) { return $this->useSystemEventInstanceMessageQuery()->filterByPrimaryKeys($systemEventInstanceMessage->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterBySystemEventInstanceMessage() only accepts arguments of type SystemEventInstanceMessage or PropelCollection'); } }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param SystemEventInstanceMessage $obj A SystemEventInstanceMessage object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool($obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }