X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/airbundle/blobdiff_plain/0d1506d19bdfd940084aa4dbe132383ddf9ce52b..eb1f263248166f36f5eb7dc17e39721e80b3e7c2:/Repository/GoogleTokenRepository.php diff --git a/Repository/GoogleTokenRepository.php b/Repository/GoogleTokenRepository.php index 3ddced2..29b96d2 100644 --- a/Repository/GoogleTokenRepository.php +++ b/Repository/GoogleTokenRepository.php @@ -29,20 +29,54 @@ class GoogleTokenRepository extends Repository { //Set the request $req = <<addScalarResult('uid', 'uid', 'integer') ->addScalarResult('access', 'access', 'string') ->addScalarResult('refresh', 'refresh', 'string') + ->addScalarResult('created', 'created', 'datetime') ->addScalarResult('expired', 'expired', 'datetime') ->addScalarResult('cids', 'cids', 'string') ->addScalarResult('cmails', 'cmails', 'string') ->addScalarResult('csummaries', 'csummaries', 'string') ->addScalarResult('csynchronizeds', 'csynchronizeds', 'string') + ->addScalarResult('dids', 'dids', 'string') + ->addScalarResult('sids', 'sids', 'string') ->addIndexByScalar('tid'); //Set result array @@ -97,11 +134,14 @@ SQL; 'uid' => $token['uid'], 'access' => $token['access'], 'refresh' => $token['refresh'], + 'created' => $token['created'], 'expired' => $token['expired'], - 'calendars' => [] + 'calendars' => [], + 'dances' => [], + 'subscriptions' => [] ]; - //Iterate on + //Iterate on calendars foreach($cids as $k => $cid) { $result[$tid]['calendars'][$cid] = [ 'id' => $cid, @@ -110,6 +150,26 @@ SQL; 'synchronized' => $csynchronizeds[$k] ]; } + + //Set dids + $dids = explode("\n", $token['dids']); + + //Iterate on dances + foreach($dids as $k => $did) { + $result[$tid]['dances'][$did] = [ + 'id' => $did + ]; + } + + //Set sids + $sids = explode("\n", $token['sids']); + + //Iterate on subscriptions + foreach($sids as $k => $sid) { + $result[$tid]['subscriptions'][$sid] = [ + 'id' => $sid + ]; + } } //Return result