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
Copy file name to clipboardExpand all lines: README.md
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,12 +58,12 @@ Benefits
58
58
Quick start
59
59
-----------
60
60
61
-
To get started quickly, try our [quick start guide][Quickstart].
61
+
To get started quickly, try our [quick start guide][Quickstart]. For a more thorough introduction, continue reading this document.
62
62
63
63
Understanding this manual
64
64
-------------------------
65
65
66
-
The first half of this manual covers Porter's main features and how to use them. The second half covers architecture, interface and implementation details for Porter developers. There's an intermission inbetween so you'll know where the cut-off is!
66
+
The first half of this manual covers Porter's main features and how to use them. The second half covers architecture, interface and implementation details for Porter developers. There's an intermission inbetween so you'll know where the division is!
67
67
68
68
Text marked as `inline code` denotes literal code, as it would appear in a PHP file. For example, `Porter` refers specifically to the class of the same name within this library, whereas *Porter* refers to this entire project as a whole.
69
69
@@ -105,23 +105,28 @@ Porter's API
105
105
106
106
`Porter`'s simple API comprises data import methods that must always be used to begin imports, instead of calling methods directly on providers or resources, in order to take advantage of Porter's features correctly.
107
107
108
-
`Porter` provides just two public methods. These are the methods to be most familiar with, where the life of a data import operation begins.
108
+
`Porter` provides just two public methods for synchronous data import. These are the methods to be most familiar with, where the life of a data import operation begins.
109
109
110
-
*`import(ImportSpecification) : PorterRecords|CountablePorterRecords`– Imports data according to the design of the specified import specification.
111
-
*`importOne(ImportSpecification) : ?array`– Imports one record according to the design of the specified import specification. If more than one record is imported, `ImportException` is thrown. Use this when you're sure a provider just returns a single record.
110
+
*`import(ImportSpecification): PorterRecords|CountablePorterRecords`– Imports one or more records from the resource contained in the specified import specification. If the total size of the collection is known, the record collection may implement `Countable`.
111
+
*`importOne(ImportSpecification): ?array`– Imports one record from the resource contained in the specified import specification. If more than one record is imported, `ImportException` is thrown. Use this when a provider just returns a single record.
112
+
113
+
Porter's asynchronous API mirrors the synchronous one with similar method names but different signatures.
114
+
115
+
*`importAsync(AsyncImportSpecification): AsyncPorterRecords|CountableAsyncPorterRecords`– Imports one or more records asynchronously from the resource contained in the specified asynchronous import specification.
116
+
*`importOneAsync(importOneAsync): Promise`– Imports one record from the resource contained in the specified asynchronous import specification.
112
117
113
118
Overview
114
119
--------
115
120
116
-
The following data flow diagram gives a high level overview of Porter's main interfaces and the data flows between them when importing data. Note that we use the term *resource* for brevity, but the actual interface is called `ProviderResource`, because *resource* is a reserved word in PHP. Also note, I don't know how to draw data flow diagrams, so just go with it.
121
+
The following data flow diagram gives a high level overview of Porter's main interfaces and the data flows between them when importing data. Note that we use the term *resource* for brevity, but the actual interface is called `ProviderResource`, because *resource* is a reserved word in PHP.
117
122
118
123
<divalign="center">
119
124
120
125
![Data flow diagram][Data flow diagram]
121
126
122
127
</div>
123
128
124
-
Our application calls `Porter::import()` with an `ImportSpecification` and receives `PorterRecords` in return. Everything else happens internally and we don't need to worry about it unless writing custom providers and resources.
129
+
Our application calls `Porter::import()` with an `ImportSpecification` and receives `PorterRecords` in return. Everything else happens internally so we don't need to worry about it unless writing custom providers, resources or connectors.
125
130
126
131
Import specifications
127
132
---------------------
@@ -555,7 +560,7 @@ Porter is published under the open source GNU Lesser General Public License v3.0
0 commit comments