public function deleteSnippet($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        try {
            $snippet=Snippet::get()->byID(intval($data->id));
            if(!empty($snippet) && $snippet!==false && $snippet->ID!=0) {
                if($snippet->canDelete()==false) {
                    $response['status']="EROR";
                    $response['message']="Not authorized";
                    
                    return $response;
                }
                
                
                //Delete the snippet
                $snippet->delete();
                
                
                $response['status']='HELO';
            }else {
                $response['status']='EROR';
                $response['message']=_t('CodeBankAPI.SNIPPET_NOT_FOUND', '_Snippet not found');
            }
        }catch(Exception $e) {
            $response['status']="EROR";
            $response['message']="Internal Server error occured";
        }
        
        return $response;
    }
public function deleteSnippet($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        try {
            $snippet=Snippet::get()->byID(intval($data->id));
            if(!empty($snippet) && $snippet!==false && $snippet->ID!=0) {
                if($snippet->canDelete()==false) {
                    $response['status']="EROR";
                    $response['message']="Not authorized";
                    
                    return $response;
                }
                
                
                //Delete the snippet
                $snippet->delete();
                
                
                $response['status']='HELO';
            }else {
                $response['status']='EROR';
                $response['message']=_t('CodeBankAPI.SNIPPET_NOT_FOUND', '_Snippet not found');
            }
        }catch(Exception $e) {
            $response['status']="EROR";
            $response['message']="Internal Server error occured";
        }
        
        return $response;
    }
public function deleteSnippet ( $ data ) { $ response = CodeBank_ClientAPI :: responseBase ( ) ; try { $ snippet = Snippet :: get ( ) -> byID ( intval ( $ data -> id ) ) ; if ( ! empty ( $ snippet ) && $ snippet !== false && $ snippet -> ID != 0 ) { if ( $ snippet -> canDelete ( ) == false ) { $ response [ 'status' ] = "EROR" ; $ response [ 'message' ] = "Not authorized" ; return $ response ; } //Delete the snippet $ snippet -> delete ( ) ; $ response [ 'status' ] = 'HELO' ; } else { $ response [ 'status' ] = 'EROR' ; $ response [ 'message' ] = _t ( 'CodeBankAPI.SNIPPET_NOT_FOUND' , '_Snippet not found' ) ; } } catch ( Exception $ e ) { $ response [ 'status' ] = "EROR" ; $ response [ 'message' ] = "Internal Server error occured" ; } return $ response ; }
Deletes a snippet from the database
@param {stdClass} $data Data passed from ActionScript
@return {array} Standard response base
Deletes a snippet from the database