public storeState ( fkooman\OAuth\Client\State $state ) | ||
$state | fkooman\OAuth\Client\State |
public function storeState(fkooman\OAuth\Client\State $state)
{
$collection = $this->mongo->selectCollection($this->db, 'state');
$result = $collection->insert(array('client_config_id' => $state->getClientConfigId(), 'user_id' => $state->getUserId(), 'scope' => $state->getScope()->isEmpty() ? null : $state->getScope()->toString(), 'state' => $state->getState(), 'issue_time' => $state->getIssueTime()));
return is_array($result) && 1 == $result['ok'] || $result;
}