Example #1
0
 /**
  * Get user data by request user and api key.
  *
  * @return array
  */
 public function getUserData()
 {
     if (!$this->user_data) {
         $authData = $this->request->getAuthData();
         if ($authData) {
             $this->user_data = fn_get_api_user($authData['user'], $authData['api_key']);
             if (!$this->user_data) {
                 $response = new Response(Response::STATUS_UNAUTHORIZED);
                 $response->send();
             }
         }
     }
     return $this->user_data;
 }