Exemplo n.º 1
1
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if (($event->getEventData() === null || !is_string($event->getEventData())) && ($event->getReceiver() === null || !is_string($event->getReceiver()))) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     if ($event->getEventData() === null) {
         $event->setEventData($event->getSender());
     }
     $event->setMessageInformation(array('User %s shared a file with you.', array(PeopleEventHandler::retrieveContactName($event->getSender()))));
     $event->setIsQuestion(false);
 }
 public function updateEventNotification(AbstractEventNotification $event)
 {
     try {
         $event->setEventData(serialize($event->getEventData()));
         $this->dao->update($event->getEventInformation());
     } catch (Exception $e) {
         throw new EyeDAOException('Unable to update the event information', 0, $e);
     }
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if (($event->getEventData() === null || !is_string($event->getEventData())) && ($event->getReceiver() === null || !is_string($event->getReceiver()))) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     if ($event->getEventData() === null) {
         $event->setEventData($event->getSender());
     }
     $username = PeopleEventHandler::retrieveContactName($event->getEventData());
     $event->setMessageInformation(array('%s accepted you and is now in your eyeOS Network', array($username)));
     $event->setIsQuestion(false);
 }
Exemplo n.º 4
0
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_string($event->getEventData())) {
         // If the event was fired by the user itself, set the eventData field
         if ($event->getReceiver() == ProcManager::getInstance()->getCurrentProcess()->getLoginContext()->getEyeosUser()->getId()) {
             $event->setEventData($event->getReceiver());
         } else {
             throw new EyeInvalidArgumentException('Missing or invalid $eventData');
         }
     }
     $userId = $event->getEventData();
     if ($userId == ProcManager::getInstance()->getCurrentProcess()->getLoginContext()->getEyeosUser()->getId()) {
         $event->setMessageInformation('Your profile was updated');
     } else {
         $username = PeopleEventHandler::retrieveContactName($userId);
         $event->setMessageInformation(array('User %s update his/her profile', array($username)));
     }
     $event->setIsQuestion(false);
 }