loevgaard / dandomain-api
Dandomain API Wrapper
Installs: 2 282
Dependents: 2
Suggesters: 0
Security: 0
Stars: 5
Watchers: 3
Forks: 3
Open Issues: 0
Requires
- php: >=7.3
- beberlei/assert: ^2.7.6
- guzzlehttp/guzzle: ^6.2 || ^7.0.1
- symfony/options-resolver: ^3.4 || ^4.4 || ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ~5.5||~6.0||~9.0
This package is auto-updated.
Last update: 2024-12-06 20:58:42 UTC
README
This is a PHP wrapper for the Dandomain API. Internally it uses Guzzle to send requests.
Installation
composer require loevgaard/dandomain-api
Usage
<?php use Loevgaard\Dandomain\Api\Api; $api = new Api('https://www.your-shop.dk', 'insert api key'); // Get modified products $dateStart = \DateTime::createFromFormat('Y-m-d', '2018-01-01'); $dateEnd = new \DateTime(); $modifiedProductCount = $api->productData->countByModifiedInterval($dateStart, $dateEnd); $pageSize = 100; $pages = ceil($modifiedProductCount / $pageSize); for($page = 1; $page <= $pages; $page++) { $products = $api->productData->getDataProductsInModifiedInterval($dateStart, $dateEnd, $page, $pageSize); }