-
Notifications
You must be signed in to change notification settings - Fork 44
/
info-service.php
51 lines (38 loc) · 1.37 KB
/
info-service.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
require __DIR__ . '/../vendor/autoload.php';
use Vin\ShopwareSdk\Data\Context;
use Vin\ShopwareSdk\Service\InfoService;
use Vin\ShopwareSdk\Service\UserService;
class InfoServiceExample {
public function execute(): void
{
require __DIR__ . '/token.php';
dump("============================================");
$context = new Context($config['shop_url'], $accessToken);
$infoService = new InfoService($context);
$infoService->refreshSchema();
dump("Current User:");
$me = (new UserService($context))->me();
dump($me);
// Uncomment to see some examples of InfoService
// dump($infoService->getSchema('product'));
// dump("============================================");
// dump("Events: ");
//
// dump((new InfoService($context))->getEvents());
// dump("============================================");
// dump("Config: ");
//
// dump((new InfoService($context))->getConfig());
// dump("============================================");
// dump("Shopware Version: ");
//
// dump((new InfoService($context))->getShopwareVersion());
// dump("============================================");
// dump("Info: ");
//
// dump((new InfoService($context))->getInfo());
}
}
$example = new InfoServiceExample();
$example->execute();