Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #59 from moltin/feature/add-main-image
Browse files Browse the repository at this point in the history
Feature/add main image
  • Loading branch information
andrew-waters authored Jul 31, 2017
2 parents be96dbc + 8ab778a commit 1705f19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ To create a file using the SDK, you need to have the file on disk:

```php
// create a file from a local disk
$moltin->files->create(['public' => 'true'], '/path/to/file.jpg');
$moltin->files->create(['public' => 'true', 'file' => '/path/to/file.jpg']);

// create a file from a URL (note: this will download the file to your local disk then upload)
$moltin->files->create(['public' => 'true'], 'https://placeholdit.imgix.net/~text?&w=350&h=150');
$moltin->files->create(['public' => 'true', 'file' => 'https://placeholdit.imgix.net/~text?&w=350&h=150']);
```

### Integrations
Expand Down
9 changes: 5 additions & 4 deletions src/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ class Resource
protected $relationshipTypeMap = [
'brands' => 'brand',
'categories' => 'category',
'children' => 'category',
'collections' => 'collection',
'children' => 'category',
'files' => 'file',
'main-image' => 'main_image',
'options' => 'variation-option',
'parent' => 'category',
'products' => 'product',
'product-modifiers' => 'product-modifier',
'variations' => 'variation',
'variation-options' => 'variation-option',
'options' => 'variation-option',
'product-modifiers' => 'product-modifier'
'variation-options' => 'variation-option'
];

// the \Moltin\Client
Expand Down

0 comments on commit 1705f19

Please sign in to comment.