public function findSnippetAutoComplete($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;
        }
        
        
        //Lookup snippets
        $snippets=Snippet::get()->filter('Title:StartsWith', Convert::raw2sql($data->pattern))->limit(20);
        
        
        $response['status']='HELO';
        $response['data']=$this->overviewList($snippets);
        
        return $response;
    }
public function findSnippetAutoComplete($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;
        }
        
        
        //Lookup snippets
        $snippets=Snippet::get()->filter('Title:StartsWith', Convert::raw2sql($data->pattern))->limit(20);
        
        
        $response['status']='HELO';
        $response['data']=$this->overviewList($snippets);
        
        return $response;
    }
public function findSnippetAutoComplete ( $ 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 ; } //Lookup snippets $ snippets = Snippet :: get ( ) -> filter ( 'Title:StartsWith' , Convert :: raw2sql ( $ data -> pattern ) ) -> limit ( 20 ) ; $ response [ 'status' ] = 'HELO' ; $ response [ 'data' ] = $ this -> overviewList ( $ snippets ) ; return $ response ; }
Finds a snippet begining with the data passed
@param {stdClass} $data Data passed from ActionScript
@return {array} Standard response base
Finds a snippet begining with the data passed