/** * Get consumer by consumer_id for a given token. * * @param int $consumerId * @return \Magento\Framework\Oauth\ConsumerInterface * @throws \Magento\Framework\Oauth\Exception */ protected function _getConsumer($consumerId) { $consumer = $this->_consumerFactory->create()->load($consumerId); if (!$consumer->getId()) { throw new \Magento\Framework\Oauth\Exception(__('A consumer with the ID %1 does not exist', [$consumerId])); } return $consumer; }
/** * Load consumer by id. * * @param int $consumerId * @return ConsumerModel * @throws \Magento\Framework\Exception\IntegrationException */ protected function _loadConsumerById($consumerId) { $consumer = $this->_consumerFactory->create()->load($consumerId); if (!$consumer->getId()) { throw new IntegrationException(__('Consumer with ID \'%1\' does not exist.', $consumerId)); } return $consumer; }