dandomain-api

This is a PHP wrapper for the Dandomain API

MIT License

Downloads
2.2K
Stars
5
Committers
3

Dandomain API PHP Wrapper

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);
}