Skip to content

Commit

Permalink
Document creation of soruce
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineOmega committed Sep 4, 2019
1 parent d97e9d3 commit 5f56ca7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@ The UXDM Spatie Data Transfer Object source allows you to source data from a Spa

### Creating

To create a new Spatie Data Transfer Object source, you must provide it with a populated Spatie Data Transfer Object
Collection.

The following example creates a Spatie Data Transfer Object source object, using a collection of users data transfer
objects.

```php
$users = new UserDTOCollection([
new UserDTO([
'id' => 1,
'name' => 'Picard`',
'email' => 'picard@enterprise-d.com',
]),
new UserDTO([
'id' => 2,
'name' => 'Janeway',
'email' => 'janeway@voyager.com',
])
]);

$spatieDataTransferObjectSource = new SpatieDataTransferObjectSource($users);
```

### Assigning to migrator

To use the Spatie Data Transfer Object source as part of a UXDM migration, you must assign it to the migrator.
Expand Down

0 comments on commit 5f56ca7

Please sign in to comment.