public function list(int $offset = 0, int $limit = self::MAX_ITEMS_PER_REQUEST, array $filters = [], array $fields = []): array
    {
        $params = [
            '_skip' => $offset,
            '_limit' => $limit,
            '_fields' => $fields,
        ];

        if (!empty($filters)) {
            $params['query'] = $this->buildQueryString($filters);
        }

        $opportunities = [];
        $response = $this->client->get($this->prepareUrlForKey('get-opportunities'), $params);

        $responseData = $response->getDecodedBody();

        foreach ($responseData['data'] as $opportunity) {
            $opportunities[] = new Opportunity($opportunity);
        }

        return $opportunities;
    }
public function list(int $offset = 0, int $limit = self::MAX_ITEMS_PER_REQUEST, array $filters = [], array $fields = []): array
    {
        $params = [
            '_skip' => $offset,
            '_limit' => $limit,
            '_fields' => $fields,
        ];

        if (!empty($filters)) {
            $params['query'] = $this->buildQueryString($filters);
        }

        $opportunities = [];
        $response = $this->client->get($this->prepareUrlForKey('get-opportunities'), $params);

        $responseData = $response->getDecodedBody();

        foreach ($responseData['data'] as $opportunity) {
            $opportunities[] = new Opportunity($opportunity);
        }

        return $opportunities;
    }
public function list ( int $ offset = 0 , int $ limit = self :: MAX_ITEMS_PER_REQUEST , array $ filters = [ ] , array $ fields = [ ] ) : array { $ params = [ '_skip' => $ offset , '_limit' => $ limit , '_fields' => $ fields , ] ; if ( ! empty ( $ filters ) ) { $ params [ 'query' ] = $ this -> buildQueryString ( $ filters ) ; } $ opportunities = [ ] ; $ response = $ this -> client -> get ( $ this -> prepareUrlForKey ( 'get-opportunities' ) , $ params ) ; $ responseData = $ response -> getDecodedBody ( ) ; foreach ( $ responseData [ 'data' ] as $ opportunity ) { $ opportunities [ ] = new Opportunity ( $ opportunity ) ; } return $ opportunities ; }
Gets up to the specified number of opportunities that matches the given
criteria.

@param int      $offset  The offset from which start getting the items
@param int      $limit   The maximum number of items to get
@param array    $filters A set of criteria to filter the items by
@param string[] $fields  The subset of fields to get (defaults to all)

@return Opportunity[]
Gets up to the specified number of opportunities that matches the given criteria .