Skip to content

Commit

Permalink
Add collection extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
leomarquine committed Sep 12, 2018
1 parent f86034c commit 8a141d7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/Extractors/Collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Collection Extractor

The collection extractor can be used to get data from any iterable item. It accepts arrays or traversables objects. The collection items must be associative arrays.

> **Tip:** Using generators will decrease memory usage.
## Options

| Name | Type | Default | Description |
| ---- |----- | ------- | ----------- |
| columns | array | null | Columns that will be extracted. |


## Usage

Default options:
```php
$etl->extract('collection', $iterable);
```

Custom options:
```php
$options = [
'columns' => ['id', 'name']
];

$etl->extract('collection', $iterable, $options);
```
2 changes: 2 additions & 0 deletions docs/Extractors/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Extractors

* [Collection](Collection.md)
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* [Introduction](Introduction.md)
* [Getting Started](GettingStarted.md)
* [Extractors](Extractors/README.md)
* [Collection](Extractors/Collection.md)

0 comments on commit 8a141d7

Please sign in to comment.