/**
  * Send Notification to user
  *
  * @param array               $aDiff
  * @param RemoteApp           $oRemoteApp
  * @param RemoteHistoryContao $aNewHistory
  *
  * @return void
  */
 private function _sendNotification($aDiff, &$oRemoteApp, $aNewHistory)
 {
     // parse template
     $sHtml = $this->getContainer()->get('templating')->render('SlashworksAppBundle:Email:cron_notification.html.twig', array('diff' => $aDiff, 'log' => $aNewHistory['Log'], 'remote_app' => $oRemoteApp, 'controlurl' => $this->_getSiteURL()));
     // get recipients
     $sRecipient = $oRemoteApp->getNotificationRecipient();
     // get sender
     $sSender = $oRemoteApp->getNotificationSender();
     // set subject and body of mail
     $sMessage = \Swift_Message::newInstance()->setSubject($this->getContainer()->get('translator')->trans('system.email.change.subject'))->setFrom($sSender)->setTo($sRecipient)->setContentType('text/html')->setBody($sHtml, 'text/html')->addPart($sHtml, 'text/html');
     // send email
     $this->getContainer()->get('mailer')->send($sMessage);
 }
 /**
  * Filter the query by a related RemoteApp object
  *
  * @param   RemoteApp|PropelObjectCollection $remoteApp The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 ApiLogQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByRemoteApp($remoteApp, $comparison = null)
 {
     if ($remoteApp instanceof RemoteApp) {
         return $this->addUsingAlias(ApiLogPeer::REMOTE_APP_ID, $remoteApp->getId(), $comparison);
     } elseif ($remoteApp instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ApiLogPeer::REMOTE_APP_ID, $remoteApp->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByRemoteApp() only accepts arguments of type RemoteApp or PropelCollection');
     }
 }
 /**
  * Exclude object from result
  *
  * @param   RemoteApp $remoteApp Object to remove from the list of results
  *
  * @return RemoteAppQuery The current query, for fluid interface
  */
 public function prune($remoteApp = null)
 {
     if ($remoteApp) {
         $this->addUsingAlias(RemoteAppPeer::ID, $remoteApp->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 /**
  * Filter the query by a related RemoteApp object
  *
  * @param   RemoteApp|PropelObjectCollection $remoteApp  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 CustomerQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByRemoteApp($remoteApp, $comparison = null)
 {
     if ($remoteApp instanceof RemoteApp) {
         return $this->addUsingAlias(CustomerPeer::ID, $remoteApp->getCustomerId(), $comparison);
     } elseif ($remoteApp instanceof PropelObjectCollection) {
         return $this->useRemoteAppQuery()->filterByPrimaryKeys($remoteApp->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByRemoteApp() only accepts arguments of type RemoteApp or PropelCollection');
     }
 }
 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volume/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->aRemoteApp instanceof Persistent) {
             $this->aRemoteApp->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     $this->aRemoteApp = null;
 }
 /**
  * Displays a form to create a new RemoteApp entity.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function newAction()
 {
     $oRemoteApp = new RemoteApp();
     $oRemoteApp->setApiUrl("swControl/");
     $oRemoteApp->setActivated(true);
     $oRemoteApp->setIncludelog(true);
     $oRemoteApp->setNotificationRecipient($this->getUser()->getEmail());
     $oRemoteApp->setNotificationSender($this->getUser()->getEmail());
     $oRemoteApp->setNotificationChange(true);
     $oRemoteApp->setNotificationError(true);
     $form = $this->createCreateForm($oRemoteApp);
     return $this->render('SlashworksAppBundle:RemoteApp:new.html.twig', array('entity' => $oRemoteApp, 'form' => $form->createView()));
 }
 /**
  * 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 RemoteApp $obj A RemoteApp 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
         RemoteAppPeer::$instances[$key] = $obj;
     }
 }
 /**
  * @param	RemoteApp $remoteApp The remoteApp object to add.
  */
 protected function doAddRemoteApp($remoteApp)
 {
     $this->collRemoteApps[] = $remoteApp;
     $remoteApp->setCustomer($this);
 }