Esempio n. 1
0
 /**
  * action message
  *
  * @param string $identifier
  * @param integer $type
  * @param integer $uid
  * @return string
  */
 public function messageAction($identifier, $type, $uid = NULL)
 {
     $messages = array();
     foreach ($this->messageRepository->findForApi($identifier, $type, $uid) as $message) {
         $messages[] = array('uid' => $message->getUid(), 'title' => $message->getTitle(), 'subtitle' => $message->getSubtitle(), 'text' => $message->getText(), 'start' => $message->getStart(), 'end' => $message->getEnd());
     }
     return json_encode($messages);
 }
Esempio n. 2
0
 /**
  * action update
  *
  * @param \GK\Stdapp\Domain\Model\Message $message
  * @return void
  */
 public function updateMessageAction(\GK\Stdapp\Domain\Model\Message $message)
 {
     if ($message->getUid() > 0) {
         $this->messageRepository->update($message);
         $this->flashMessageContainer->add('Your Message was updated.');
     } else {
         $this->messageRepository->add($message);
         $this->flashMessageContainer->add('Your Message was added.');
     }
     $this->redirect('editMessage');
 }
 /**
  * action update
  *
  * @param \GK\Stdapp\Domain\Model\Message $message
  * @return void
  */
 public function updateAction(\GK\Stdapp\Domain\Model\Message $message)
 {
     if ($message->getUid() > 0) {
         $this->messageRepository->update($message);
         $this->flashMessageContainer->add('Your Message was updated.');
     } else {
         $customer = $this->portalUser->getCustomer()->_loadRealInstance();
         $customer->addMessage($message);
         $this->customerRepository->update($customer);
         $this->flashMessageContainer->add('Your Message was added.');
     }
     $this->redirect('edit');
 }