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;
    }
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;
    }
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 ; }
Get collection of items
@param  array $fields
@return [type]
Get collection of items