public function getUserInfo($id) { // Get the Contact by email or userId to find the contactId // Instantiate the contact controller $ContactController = $this->getServiceLocator()->get('ContactController'); $ContactController->setValidateOAuth(false); // Get the contact with the user_id associated to the Token $where = new Where(); $where->nest()->equalTo(CONTACT_EMAIL, $id)->or->equalTo(CONTACT_USERID, $id); $contact = $ContactController->get($where); if ($contact->getVariable('status') == STATUS_FAILED) { throw new CommonException(array('messageId' => 'globals.query.record_not_found', 'parms' => array('id' => $id), EXCEPTION_ERRORKEY => 404, 'code' => 404)); } $this->setValidateOAuth(false); $result = parent::get($contact->getVariable($ContactController->getTable()->getPk())); $this->setValidateOAuth(true); // TODO - Validate only one record found return $result; }