Пример #1
0
 /**
  * @return response
  */
 public function getAll()
 {
     $response = new Response();
     $messages = (object) null;
     $messages->CommonResources = CommonResources::getAllMessage();
     $messages->MenuResources = MenuResources::getAllMessage();
     $messages->ConfigurationResources = ConfigurationResources::getAllMessage();
     $messages->DictionaryResources = DictionaryResources::getAllMessage();
     $response->model = $messages;
     return $response;
 }
Пример #2
0
 public function getMessages()
 {
     $messages = array();
     if (parent::getMessages()) {
         foreach (parent::getMessages() as $message) {
             switch ($message->getType()) {
                 case 'PresenceOf':
                     $messages[] = new Message(null, Constants::getMessageType()['Error'], String::format(CommonResources::getMessage('Msg_PresenceOf'), DictionaryResources::getMessage($message->getField())));
                     break;
                 default:
                     $messages[] = new Message(null, Constants::getMessageType()['Error'], $message->getMessage());
                     break;
             }
         }
     }
     return $messages;
 }
 /**
  * @param  identfier
  * @return the messages
  */
 public function delete($id)
 {
     $response = new Response();
     $entity = TranslationRepository::getById($id);
     $errMsg = TranslationRepository::delete($id);
     if ($errMsg) {
         throw new CustomException($errMsg, Constants::errorCode()['BadRequest']);
     } else {
         $response->messages[] = new Message(null, Constants::getMessageType()['Success'], String::format(CommonResources::getMessage('Msg_SuccessfullyDeleted'), DictionaryResources::getMessage('Translation'), $entity->donor_name));
     }
     return $response;
 }