/** * Delete subscriber * * @param array $update Update * * @return array */ protected function _deleteSubscriber(array $update) { $chatId = $this->_updateHelper->getChatId($update); $chatName = $this->_updateHelper->getChatName($update); $chatData = [Chat::COLUMN_CHAT_ID => $chatId, Chat::COLUMN_CHAT_NAME => $chatName]; $chat = $this->_chat->setId($chatId)->load(); if ($chat) { $this->_chat->delete(); $chatData['success'] = true; $chatData[Chat::COLUMN_REDMINE_KEY_ID] = $chat[Chat::COLUMN_REDMINE_KEY_ID]; } else { $chatData['success'] = false; } return $chatData; }
/** * Get subscriber * * @param array $update Update * * @return array */ protected function _getSubscriber(array $update) { return $this->_chat->setId($this->_updateHelper->getChatId($update))->load(); }