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( |
||
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 | $builder = new Read( |
||
71 | $connection->getAppId(), |
||
|
|||
72 | $typeId, |
||
73 | $id, |
||
74 | $connection ?: HubSpot::getIntegrationConnection(), |
||
75 | $cache ?: HubSpot::getCache(), |
||
76 | $logger ?: HubSpot::getLogger(), |
||
77 | $config |
||
78 | ); |
||
79 | |||
80 | return $builder->build(); |
||
81 | } |
||
82 | |||
83 | |||
84 | |||
85 | /******************************************* |
||
86 | * UPSERT |
||
87 | *******************************************/ |
||
88 | |||
89 | /** |
||
90 | * @param string $typeId |
||
91 | * @param string $id |
||
92 | * @param array $payload |
||
93 | * @param IntegrationConnectionInterface|null $connection |
||
94 | * @param CacheInterface|null $cache |
||
95 | * @param LoggerInterface|null $logger |
||
96 | * @param array $config |
||
97 | * @return ResponseInterface |
||
98 | */ |
||
99 | public static function upsert( |
||
118 | |||
119 | /** |
||
120 | * @param string $typeId |
||
121 | * @param string $id |
||
122 | * @param array $payload |
||
123 | * @param IntegrationConnectionInterface|null $connection |
||
124 | * @param CacheInterface|null $cache |
||
125 | * @param LoggerInterface|null $logger |
||
126 | * @param array $config |
||
127 | * @return callable |
||
128 | */ |
||
129 | public static function upsertRelay( |
||
155 | |||
156 | |||
157 | /******************************************* |
||
158 | * BATCH |
||
159 | *******************************************/ |
||
160 | |||
161 | /** |
||
162 | * @param array $payload |
||
163 | * @param IntegrationConnectionInterface|null $connection |
||
164 | * @param LoggerInterface|null $logger |
||
165 | * @param array $config |
||
166 | * @return ResponseInterface |
||
167 | */ |
||
168 | public static function batch( |
||
181 | |||
182 | /** |
||
183 | * @param array $payload |
||
184 | * @param IntegrationConnectionInterface|null $connection |
||
185 | * @param LoggerInterface|null $logger |
||
186 | * @param array $config |
||
187 | * @return callable |
||
188 | */ |
||
189 | public static function batchRelay( |
||
206 | } |
||
207 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: