public function findUnreadMessagesForApi($userId, $ignoreList, $timeStamp = null) { $list = array(); $messages = $this->messageDao->findUnreadMessages($userId, $ignoreList, $timeStamp, $this->getActiveModeList()); foreach ($messages as $id => $message) { $list[] = $this->getMessageDataForApi($message); } return $list; }