Ejemplo n.º 1
0
 /**
  * This will send an email alert along with the notification.
  * @throws NotSupportedException
  */
 public function actionCreateStuckJobNotification()
 {
     if (!Group::isUserASuperAdministrator(Yii::app()->user->userModel)) {
         throw new NotSupportedException();
     }
     MonitorJob::makeJobStuckNotification(array('Process Outbound Email Job', 'Process Inbound Email Job'));
 }
 /**
  * @param User $userToSendTo
  * @param MessageLogger $messageLogger
  */
 public function run(User $userToSendTo, $messageLogger)
 {
     MonitorJob::makeJobStuckNotification(array('Process Outbound Email Job', 'Process Inbound Email Job'));
     $messageLogger->addInfoMessage('Sending a job is stuck message');
     JobsManagerUtil::makeMonitorStuckJobNotification();
     $messageLogger->addInfoMessage('Sending monitor job stuck message');
     //Clear out notifications for super user
     $searchAttributeData = array();
     $searchAttributeData['clauses'] = array(1 => array('attributeName' => 'owner', 'relatedAttributeName' => 'id', 'operatorType' => 'equals', 'value' => Yii::app()->user->userModel->id));
     $searchAttributeData['structure'] = '1';
     $joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Notification');
     $where = RedBeanModelDataProvider::makeWhere('Notification', $searchAttributeData, $joinTablesAdapter);
     $models = Notification::getSubset($joinTablesAdapter, null, null, $where, null);
     foreach ($models as $model) {
         $model->delete();
     }
 }