original_string: public function getSnippetRevisions($data) {
          $response=CodeBank_ClientAPI::responseBase();
          
          //Ensure logged in
          if(!Permission::check('CODE_BANK_ACCESS')) {
              $response['status']='EROR';
              $response['message']=_t('CodeBankAPI.PERMISSION_DENINED', '_Permission Denied');
              
              return $response;
          }
          
          
          $snippet=Snippet::get()->byID($data->id);
          if(!empty($snippet) && $snippet!==false && $snippet->ID!=0) {
              $revisions=$snippet->Versions()->map('ID', 'Created');
              
              $i=0;
              foreach($revisions as $id=>$date) {
                  $response['data'][]=array(
                                          'id'=>$id,
                                          'date'=>($i==0 ? '{Current Revision}':$date)
                                      );
                  $i++;
              }
          }else {
              $response['status']='EROR';
              $response['message']=_t('CodeBankAPI.SNIPPET_NOT_FOUND', '_Snippet not found');
          }
          
          return $response;
      }
code: public function getSnippetRevisions($data) {
          $response=CodeBank_ClientAPI::responseBase();
          
          //Ensure logged in
          if(!Permission::check('CODE_BANK_ACCESS')) {
              $response['status']='EROR';
              $response['message']=_t('CodeBankAPI.PERMISSION_DENINED', '_Permission Denied');
              
              return $response;
          }
          
          
          $snippet=Snippet::get()->byID($data->id);
          if(!empty($snippet) && $snippet!==false && $snippet->ID!=0) {
              $revisions=$snippet->Versions()->map('ID', 'Created');
              
              $i=0;
              foreach($revisions as $id=>$date) {
                  $response['data'][]=array(
                                          'id'=>$id,
                                          'date'=>($i==0 ? '{Current Revision}':$date)
                                      );
                  $i++;
              }
          }else {
              $response['status']='EROR';
              $response['message']=_t('CodeBankAPI.SNIPPET_NOT_FOUND', '_Snippet not found');
          }
          
          return $response;
      }
code_tokens: public function getSnippetRevisions ( $ data ) { $ response = CodeBank_ClientAPI :: responseBase ( ) ; //Ensure logged in if ( ! Permission :: check ( 'CODE_BANK_ACCESS' ) ) { $ response [ 'status' ] = 'EROR' ; $ response [ 'message' ] = _t ( 'CodeBankAPI.PERMISSION_DENINED' , '_Permission Denied' ) ; return $ response ; } $ snippet = Snippet :: get ( ) -> byID ( $ data -> id ) ; if ( ! empty ( $ snippet ) && $ snippet !== false && $ snippet -> ID != 0 ) { $ revisions = $ snippet -> Versions ( ) -> map ( 'ID' , 'Created' ) ; $ i = 0 ; foreach ( $ revisions as $ id => $ date ) { $ response [ 'data' ] [ ] = array ( 'id' => $ id , 'date' => ( $ i == 0 ? '{Current Revision}' : $ date ) ) ; $ i ++ ; } } else { $ response [ 'status' ] = 'EROR' ; $ response [ 'message' ] = _t ( 'CodeBankAPI.SNIPPET_NOT_FOUND' , '_Snippet not found' ) ; } return $ response ; }
docstring: Gets a revisions of the snippet
  @param {stdClass} $data Data passed from ActionScript
  @return {array} Standard response base
docstring_tokens: Gets a revisions of the snippet