public function Account::testConnection in GatherContent 8
Same name and namespace in other branches
- 8.3 src/DAO/Account.php \Drupal\gathercontent\DAO\Account::testConnection()
Test connection with current credentials.
Return value
bool Return TRUE on success connection otherwise FALSE.
File
- src/
DAO/ Account.php, line 96 - Contains GatherContent\Accont class.
Class
- Account
- Class Account.
Namespace
Drupal\gathercontent\DAOCode
public function testConnection() {
try {
$response = $this->client
->get('/me');
if ($response
->getStatusCode() === 200) {
return TRUE;
}
else {
return FALSE;
}
} catch (\Exception $e) {
return FALSE;
}
}