public function getConsumer(Request &$request) { $consumer_key = @$request->getParameter("consumer_key"); if (!$consumer_key) { throw new Exception("Invalid consumer key", 400); } $consumer = $this->_dataStore->lookupConsumer($consumer_key); if (!$consumer) { throw new Exception("Invalid consumer", 400); } return $consumer; }