1 | <?php |
||
24 | class TimelineEvent |
||
25 | { |
||
26 | /** |
||
27 | * @param string $id |
||
28 | * @param string $typeId |
||
29 | * @param IntegrationConnectionInterface|null $connection |
||
30 | * @param CacheInterface|null $cache |
||
31 | * @param LoggerInterface|null $logger |
||
32 | * @param array $config |
||
33 | * @return ResponseInterface |
||
34 | */ |
||
35 | public static function read( |
||
36 | string $id, |
||
37 | string $typeId, |
||
38 | IntegrationConnectionInterface $connection = null, |
||
39 | CacheInterface $cache = null, |
||
40 | LoggerInterface $logger = null, |
||
41 | array $config = [] |
||
42 | ): ResponseInterface { |
||
43 | return static::readRelay( |
||
44 | $id, |
||
45 | $typeId, |
||
46 | $connection, |
||
47 | $cache, |
||
48 | $logger, |
||
49 | $config |
||
50 | )(); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @param string $id |
||
55 | * @param string $typeId |
||
56 | * @param IntegrationConnectionInterface|null $connection |
||
57 | * @param CacheInterface|null $cache |
||
58 | * @param LoggerInterface|null $logger |
||
59 | * @param array $config |
||
60 | * @return callable |
||
61 | */ |
||
62 | public static function readRelay( |
||
63 | string $id, |
||
64 | string $typeId, |
||
65 | IntegrationConnectionInterface $connection = null, |
||
66 | CacheInterface $cache = null, |
||
67 | LoggerInterface $logger = null, |
||
68 | array $config = [] |
||
69 | ): callable { |
||
70 | |||
71 | $connection = $connection ?: HubSpot::getIntegrationConnection(); |
||
72 | |||
73 | $builder = new Read( |
||
74 | $connection->getAppId(), |
||
75 | $typeId, |
||
76 | $id, |
||
77 | $connection, |
||
78 | $cache ?: HubSpot::getCache(), |
||
79 | $logger ?: HubSpot::getLogger(), |
||
80 | $config |
||
81 | ); |
||
82 | |||
83 | return $builder->build(); |
||
84 | } |
||
85 | |||
86 | |||
87 | |||
88 | /******************************************* |
||
89 | * UPSERT |
||
90 | *******************************************/ |
||
91 | |||
92 | /** |
||
93 | * @param string $typeId |
||
94 | * @param string $id |
||
95 | * @param array $payload |
||
96 | * @param IntegrationConnectionInterface|null $connection |
||
97 | * @param CacheInterface|null $cache |
||
98 | * @param LoggerInterface|null $logger |
||
99 | * @param array $config |
||
100 | * @return ResponseInterface |
||
101 | */ |
||
102 | public static function upsert( |
||
121 | |||
122 | /** |
||
123 | * @param string $typeId |
||
124 | * @param string $id |
||
125 | * @param array $payload |
||
126 | * @param IntegrationConnectionInterface|null $connection |
||
127 | * @param CacheInterface|null $cache |
||
128 | * @param LoggerInterface|null $logger |
||
129 | * @param array $config |
||
130 | * @return callable |
||
131 | */ |
||
132 | public static function upsertRelay( |
||
160 | |||
161 | |||
162 | /******************************************* |
||
163 | * BATCH |
||
164 | *******************************************/ |
||
165 | |||
166 | /** |
||
167 | * @param array $payload |
||
168 | * @param IntegrationConnectionInterface|null $connection |
||
169 | * @param LoggerInterface|null $logger |
||
170 | * @param array $config |
||
171 | * @return ResponseInterface |
||
172 | */ |
||
173 | public static function batch( |
||
186 | |||
187 | /** |
||
188 | * @param array $payload |
||
189 | * @param IntegrationConnectionInterface|null $connection |
||
190 | * @param LoggerInterface|null $logger |
||
191 | * @param array $config |
||
192 | * @return callable |
||
193 | */ |
||
194 | public static function batchRelay( |
||
212 | } |
||
213 |