/[drupal]/contributions/modules/ShindigIntegrator/shindig_integrator/shindig_files/ShindigIntegratorAppDataService.php
ViewVC logotype

Diff of /contributions/modules/ShindigIntegrator/shindig_integrator/shindig_files/ShindigIntegratorAppDataService.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Mon Dec 8 07:23:01 2008 UTC revision 1.2, Thu Oct 22 10:51:44 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: ShindigIntegratorAppDataService.php,v 1.1.4.2 2009/08/14 10:09:17 impetus Exp $
3  /**  /**
4   * @file   * @file
5   * OpenSocial AppData Service   * OpenSocial AppData Service
# Line 26  class ShindigIntegratorAppDataService im Line 26  class ShindigIntegratorAppDataService im
26          */          */
27          public function deletePersonData($userId, GroupId $groupId, $appId, $fields, SecurityToken $token)          public function deletePersonData($userId, GroupId $groupId, $appId, $fields, SecurityToken $token)
28          {          {
29              if ($fields == null || $fields[0] == '*') {
30                    $key = "*";
31            if (! ShindigIntegratorDbFetcher::get()->deleteAppData($userId, $key, $token->getAppId())) {
32                                                    throw new SocialSpiException("Internal server error", ResponseError::$INTERNAL_ERROR);
33                    }
34            return null;
35              }
36                  foreach ($fields as $key) {                  foreach ($fields as $key) {
37                          if (! ShindigIntegratorAppDataService::isValidKey($key)) {                          if (! ShindigIntegratorAppDataService::isValidKey($key)) {
38                                  throw new SocialSpiException("The person app data key had invalid characters", ResponseError::$BAD_REQUEST);                                  throw new SocialSpiException("The person app data key had invalid characters", ResponseError::$BAD_REQUEST);
# Line 62  class ShindigIntegratorAppDataService im Line 69  class ShindigIntegratorAppDataService im
69          */          */
70          public function getPersonData($userId, GroupId $groupId, $appId, $fields, SecurityToken $token)          public function getPersonData($userId, GroupId $groupId, $appId, $fields, SecurityToken $token)
71          {          {
72                    if (! isset($fields[0])) {
73              $fields[0] = '@all';
74            }
75                  $ids = ShindigIntegratorDbFetcher::get()->getIdSet($userId, $groupId, $token);                  $ids = ShindigIntegratorDbFetcher::get()->getIdSet($userId, $groupId, $token);
76                  $data = ShindigIntegratorDbFetcher::get()->getAppData($ids, $fields, $appId);                  $data = ShindigIntegratorDbFetcher::get()->getAppData($ids, $fields, $appId);
                 if (!count($data)) {  
                         throw new SocialSpiException("Data Not Found".print_r($appId, true), ResponseError::$NOT_FOUND);  
                 }  
77                  return new DataCollection($data);                  return new DataCollection($data);
78          }          }
79    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2