public function getConversationHistoryForApi($conversationId, $beforeMessageId) { $count = 10; $deletedTimestamp = $this->getConversationDeletedTimestamp($conversationId); $dtoList = $this->messageDao->findHistory($conversationId, $beforeMessageId, $count, $deletedTimestamp); $list = array(); foreach ($dtoList as $message) { $list[] = $this->getMessageDataForApi($message); } $data = array('log' => $list); return $data; }