コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
 /**
  * Get redmine API key from update
  *
  * @param array $update Update
  *
  * @return bool|string
  */
 protected function _getRedmineKeyFromUpdate(array $update)
 {
     return $this->_messageHelper->getArgumentFromMessage($this->_updateHelper->getMessageText($update));
 }