getClient() 정적인 공개 메소드

Checks the authentication.
static public getClient ( String $username, $password ) : Model
$username String
리턴 Model
 /**
  * Constructs a new base controller.
  */
 public function __construct()
 {
     $this->lrs = Helpers::getLrsFromAuth();
     list($username, $password) = Helpers::getUserPassFromAuth();
     $this->client = Helpers::getClient($username, $password);
 }
 /**
  * Gets the Lrs associated with the given username and password.
  * @param String $username
  * @param String $password
  * @return Lrs
  */
 static function getLrsFromUserPass($username, $password)
 {
     $client = Helpers::getClient($username, $password);
     $lrs = $client === null ? null : \Lrs::find($client->lrs_id);
     if ($lrs === null) {
         throw new Exceptions\Exception('Unauthorized request.', 401);
     }
     return $lrs;
 }