private function getLatchStatus($latchId) { $api = LatchHelper::getLatchConnection(); if ($api != NULL) { $response = $api->status($latchId); if ($this->isLatchResponseValid($response)) { $appId = $this->params->get("latch_appID"); $status = $response->getData()->{"operations"}->{$appId}->{"status"}; $adaptedResponse = array('accountBlocked' => $status == "off"); if (property_exists($response->getData()->{"operations"}->{$appId}, "two_factor")) { $adaptedResponse['twoFactor'] = $response->getData()->{"operations"}->{$appId}->{"two_factor"}->{"token"}; } return $adaptedResponse; } } return array('accountBlocked' => false); }