dafiti / datajet-client
Dafiti Datajet Client for PHP
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 3 440
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 14
Forks: 2
Open Issues: 0
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: ^6.1.0
- respect/validation: ^1.0.2
- symfony/monolog-bundle: ~2.4
Requires (Dev)
- fabpot/php-cs-fixer: @stable
- phpunit/phpunit: ~4.8
This package is not auto-updated.
Last update: 2021-06-12 01:01:07 UTC
README
Datajet.IO Client for PHP
Instalation
The package is available on Packagist. Autoloading is PSR-4 compatible.
{ "require": { "dafiti/datajet-client": "dev-master" } }
Usage
Basic
$config = [ 'data' => [ 'uri' => '<import-uri>', // eg.: http://fisherman.sae.datajet.io 'key' => '<your-import-key>' ], 'search' => [ 'uri' => '<search-uri>', // eg.: http://hawk.sae.datajet.io 'key' => '<your-search-key>' ] ]; $client = \Dafiti\Datajet\Client::create($config);
All returned data is an array.
Import products
$products = [ [ 'id' => '1', 'title' => 'Product', 'payload' => [ 'some' => 'thing' ], 'brand' => [ 'id' => '2', 'name' => 'Dafiti', 'slug' => 'dafiti' ], 'attributes' => [ 'color' => 'black' ], 'price' => [ 'current' => 100.00, 'previous' => 200.00, 'currency' => 'BRL' ], 'sku' => 'APCC', 'published_at' => date('Y-m-d H:i:s'), 'stock_count' => 3 ] ]; $client->product->import($products);
Please see Datajet.IO docs: https://github.com/datajet-io/docs/wiki
Search products
$search = [ 'q' => 'shoe', 'filters' => [ 'brand.id' => ['1'] ], 'size' => 10, 'page' => 1 ]; $client->product->search($search);
Please see Datajet.IO docs: https://github.com/datajet-io/docs/wiki
Delete products
$client->product->delete($id);
Please see Datajet.IO docs: https://github.com/datajet-io/docs/wiki
License
MIT License