original_string: public function get($type = 'sent', $fields = ['*'])
      {
          // filter anything that is not an available type
          $type = in_array($type, ['sent', 'draft', 'outbox']) ? $type : 'sent';
  
          $params = $this->prepareParams();
  
          if ( ! empty($fields) && is_array($fields) && $fields != ['*']) {
              $params['fields'] = $fields;
          }
  
          $response = $this->restClient->get($this->endpoint . '/' . $type, $params);
  
          $entities = $this->generateCollection($response['body']);
  
          return $entities;
      }
code: public function get($type = 'sent', $fields = ['*'])
      {
          // filter anything that is not an available type
          $type = in_array($type, ['sent', 'draft', 'outbox']) ? $type : 'sent';
  
          $params = $this->prepareParams();
  
          if ( ! empty($fields) && is_array($fields) && $fields != ['*']) {
              $params['fields'] = $fields;
          }
  
          $response = $this->restClient->get($this->endpoint . '/' . $type, $params);
  
          $entities = $this->generateCollection($response['body']);
  
          return $entities;
      }
code_tokens: public function get ( $ type = 'sent' , $ fields = [ '*' ] ) { // filter anything that is not an available type $ type = in_array ( $ type , [ 'sent' , 'draft' , 'outbox' ] ) ? $ type : 'sent' ; $ params = $ this -> prepareParams ( ) ; if ( ! empty ( $ fields ) && is_array ( $ fields ) && $ fields != [ '*' ] ) { $ params [ 'fields' ] = $ fields ; } $ response = $ this -> restClient -> get ( $ this -> endpoint . '/' . $ type , $ params ) ; $ entities = $ this -> generateCollection ( $ response [ 'body' ] ) ; return $ entities ; }
docstring: Get collection of items
  @param  array $fields
  @return [type]
docstring_tokens: Get collection of items