From 37fe77bda520fb3e6e5505a07951b89de9914043 Mon Sep 17 00:00:00 2001 From: Andrew Waters Date: Wed, 28 Jun 2017 15:45:31 +0100 Subject: [PATCH 1/2] Fixes file example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 60808c5..97a7b49 100644 --- a/README.md +++ b/README.md @@ -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 From 8ab778ae23c8fa725c5f1ed3443a5c66d0d6f340 Mon Sep 17 00:00:00 2001 From: Andrew Waters Date: Wed, 28 Jun 2017 15:46:01 +0100 Subject: [PATCH 2/2] Reorder alphabetically and add main-image relationships --- src/Resource.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Resource.php b/src/Resource.php index aa6f786..ac8b29f 100644 --- a/src/Resource.php +++ b/src/Resource.php @@ -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