Example #1
0
 public function message_details_get($context)
 {
     if ($context->more && $context->channel) {
         $application = GalaxyAPI::applicationIdForChannelId($context->channel);
         $options = array('default' => GalaxyAPI::databaseForId($application));
         $channel = GalaxyAPI::database(GalaxyAPIConstants::kDatabaseMongoDB, GalaxyAPI::databaseForId($context->channel), $options);
         $data = $channel->findOne(array('_id' => $context->more));
         return GalaxyResponse::responseWithData($data);
     } else {
         return GalaxyResponse::responseWithError(GalaxyError::errorWithString('invalid message'));
     }
 }