Skip to content

Commit a17d95f

Browse files
authored
Add support for new profile-milestone table (#11)
- fixes #8
1 parent ff924cc commit a17d95f

File tree

6 files changed

+49
-0
lines changed

6 files changed

+49
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [1.1.0] - 2019-11-29
4+
### Added
5+
- Add support for new profile-milestone
6+
37
## [1.0.1] - 2019-11-29
48
### Changed
59
- Add missing timestamp restrictions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The following methods are available:
5656
- ```getTrackingHistory()```
5757
- ```getTrackingTypes()```
5858
- ```getNewsletterSendlogs(int $customer_id)```
59+
- ```getMilestoneProfiles(int $customer_id)```
5960

6061
#### Formats
6162

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Scn\EvalancheReportingApiConnector\Client;
6+
7+
use Scn\EvalancheReportingApiConnector\EvalancheConfigInterface;
8+
9+
final class MilestoneProfileClient extends AbstractClient
10+
{
11+
private $customerId;
12+
13+
public function __construct(
14+
int $customerId,
15+
\GuzzleHttp\Client $httpClient,
16+
EvalancheConfigInterface $evalancheConfig
17+
)
18+
{
19+
parent::__construct($httpClient, $evalancheConfig);
20+
$this->customerId = $customerId;
21+
}
22+
23+
protected function isRestrictable(): bool
24+
{
25+
return true;
26+
}
27+
28+
protected function getAdditionalParam(): array
29+
{
30+
return ['customer_id' => $this->customerId];
31+
}
32+
33+
protected function getTableName(): string
34+
{
35+
return 'milestone-profiles';
36+
}
37+
}

src/EvalancheConnection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ public function getNewsletterSendlogs(int $customer_id): Client\ClientInterface
130130
return new Client\NewsletterSendlogsClient($customer_id, $this->httpClient, $this->config);
131131
}
132132

133+
public function getMilestoneProfiles(int $customerId): Client\ClientInterface
134+
{
135+
return new Client\MilestoneProfileClient($customerId, $this->httpClient, $this->config);
136+
}
137+
133138
private function createClient(string $clientClass): Client\ClientInterface
134139
{
135140
return new $clientClass($this->httpClient, $this->config);

tests/Client/ClientTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ public function clientAdditionalDataProvider()
240240
[LeadpagesClient::class, 'leadpages', 'customer_id', 42],
241241
[CheckpointsClient::class, 'checkpoints', 'customer_id', 42],
242242
[NewsletterSendlogsClient::class, 'newslettersendlogs', 'customer_id', 42],
243+
[MilestoneProfileClient::class, 'milestone-profiles', 'customer_id', 42],
243244
];
244245
}
245246

tests/EvalancheConnectionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public function clientParamDataProvider()
100100
[Client\ProfileChangelogsClient::class, 'getProfileChangelogs', 42],
101101
[Client\ProfilesClient::class, 'getProfiles', 42],
102102
[Client\NewsletterSendlogsClient::class, 'getNewsletterSendlogs', 42],
103+
[Client\MilestoneProfileClient::class, 'getMilestoneProfiles', 42],
103104
];
104105
}
105106
}

0 commit comments

Comments
 (0)