-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathEventService.php
62 lines (56 loc) · 1.58 KB
/
EventService.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
52
53
54
55
56
57
58
59
60
61
62
<?php
namespace Pixers\SalesManagoAPI\Service;
/**
* @author Sylwester Łuczak <sylwester.luczak@pixers.pl>
*/
class EventService extends AbstractService
{
/**
* Creating a new external event.
*
* @param string $owner Contact owner e-mail address
* @param string $email Contact e-mail address
* @param array $data Contact event data
* @return array
*/
public function create($owner, $email, array $data)
{
$data = self::mergeData($data, [
'owner' => $owner,
'email' => $email,
]);
return $this->client->doPost('contact/addContactExtEvent', $data);
}
/**
* Updating external event.
*
* @param string $owner Contact owner e-mail address
* @param string $eventId Ext event identifier
* @param array $data New event data
* @return array
*/
public function update($owner, $eventId, array $data)
{
$data = self::mergeData($data, [
'owner' => $owner,
'contactEvent' => [
'eventId' => $eventId,
],
]);
return $this->client->doPost('contact/updateContactExtEvent', $data);
}
/**
* Deleting contact external event.
*
* @param string $owner Contact owner e-mail address
* @param string $eventId Ext event identifier
* @return array
*/
public function delete($owner, $eventId)
{
return $this->client->doPost('contact/deleteContactExtEvent', [
'owner' => $owner,
'eventId' => $eventId,
]);
}
}