You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -228,12 +228,14 @@ Resources fetch data using the supplied connector and format it as a collection
228
228
```php
229
229
public function getProviderClassName() : string;
230
230
public function getProviderTag() : string;
231
-
public function fetch(Connector $connector) : Iterator;
231
+
public function fetch(Connector $connector, EncapsulatedOptions $options = null) : Iterator;
232
232
```
233
233
234
234
A resource supplies the class name of the provider it expects a connector from when `getProviderClassName()` is called. A used-defined tag can be specified to identify a particular Provider instance when `getProviderTag()` is called.
235
235
236
-
When `fetch()` is called it is passed the connector from which data must be fetched. The resource must ensure data is formatted as iterator of array values whilst remaining as true to the original format as possible; that is, we must avoid renaming or restructuring data because it is the caller's prerogative to perform data customization if desired.
236
+
When `fetch()` is called it is passed the connector from which data must be fetched. The resource must ensure data is formatted as an iterator of array values whilst remaining as true to the original format as possible; that is, we must avoid renaming or restructuring data because it is the caller's prerogative to perform data customization if desired.
237
+
238
+
Providers may also supply options to `fetch()`. Such options are typically used to convey API keys or other options common to all of a provider's resources. When specified, a resource must ensure the options are transmitted to the connector.
237
239
238
240
### Writing a resource
239
241
@@ -331,7 +333,14 @@ Limitations
331
333
Testing
332
334
-------
333
335
334
-
Porter is fully unit tested. Run the tests with `bin/test` from a shell.
336
+
Porter is almost fully unit tested. Run the tests with `bin/test` from a shell.
0 commit comments