/** * Returns conversation's messages list * * @param int $conversationId * @throws InvalidArgumentException * @return MAILBOX_BOL_Conversation */ public function getConversationMessagesList($conversationId) { if (empty($conversationId)) { throw new InvalidArgumentException("Not numeric params were provided! Numbers are expected!"); } return $this->messageDao->findListByConversationId($conversationId); }
public function getMessagesForApi($userId, $conversationId) { $list = array(); $length = 0; if (!empty($conversationId)) { $count = 16; $deletedTimestamp = $this->getConversationDeletedTimestamp($conversationId); $dtoList = $this->messageDao->findListByConversationId($conversationId, $count, $deletedTimestamp); foreach ($dtoList as $message) { $list[] = $this->getMessageDataForApi($message); } $length = $this->getConversationLength($conversationId); } return array('list' => $list, 'length' => $length); }