1 | <?php |
||
43 | class Contacts extends Component implements CRUDInterface |
||
44 | { |
||
45 | use traits\SyncByElementTrait, |
||
46 | traits\ReadObjectTrait, |
||
47 | traits\UpsertObjectTrait, |
||
48 | traits\DeleteObjectTrait; |
||
49 | |||
50 | /** |
||
51 | * The HubSpot Resource name |
||
52 | */ |
||
53 | const HUBSPOT_RESOURCE = 'contacts'; |
||
54 | |||
55 | /** |
||
56 | * @return array |
||
57 | */ |
||
58 | public static function defaultTransformer() |
||
71 | |||
72 | /** |
||
73 | * @param array $config |
||
74 | * @return ObjectAccessorInterface |
||
75 | */ |
||
76 | public function getAccessorCriteria(array $config = []): ObjectAccessorInterface |
||
77 | { |
||
78 | return new ContactAccessor($config); |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * @param array $config |
||
83 | * @return ObjectMutatorInterface |
||
84 | */ |
||
85 | public function getMutatorCriteria(array $config = []): ObjectMutatorInterface |
||
86 | { |
||
87 | return new ContactMutator($config); |
||
88 | } |
||
89 | |||
90 | /** |
||
91 | * @inheritdoc |
||
92 | */ |
||
93 | protected static function createRelayBuilderClass(): string |
||
97 | |||
98 | /** |
||
99 | * @inheritdoc |
||
100 | */ |
||
101 | protected static function readRelayBuilderClass(): string |
||
105 | |||
106 | /** |
||
107 | * @inheritdoc |
||
108 | */ |
||
109 | protected static function updateRelayBuilderClass(): string |
||
113 | |||
114 | /** |
||
115 | * @inheritdoc |
||
116 | */ |
||
117 | protected static function deleteRelayBuilderClass(): string |
||
121 | |||
122 | /** |
||
123 | * @inheritdoc |
||
124 | */ |
||
125 | protected static function batchRelayBuilderClass(): string |
||
129 | |||
130 | /******************************************* |
||
131 | * SYNC (OVERRIDE) |
||
132 | *******************************************/ |
||
133 | |||
134 | /** |
||
135 | * @param ElementInterface $element |
||
136 | * @param Objects $field |
||
137 | * @param array $payload |
||
138 | * @param string $id |
||
139 | * @param ConnectionInterface|null $connection |
||
140 | * @param CacheInterface|null $cache |
||
141 | * @return bool |
||
142 | * @throws \yii\base\InvalidConfigException |
||
143 | */ |
||
144 | public function rawSyncUp( |
||
194 | |||
195 | /******************************************* |
||
196 | * BATCH |
||
197 | *******************************************/ |
||
198 | |||
199 | |||
200 | /** |
||
201 | * @param ContactBatchMutatorInterface $criteria |
||
202 | * @return ResponseInterface |
||
203 | * @throws \yii\base\InvalidConfigException |
||
204 | */ |
||
205 | public function httpBatch( |
||
213 | |||
214 | /** |
||
215 | * @param array $payload |
||
216 | * @param ConnectionInterface|string|null $connection |
||
217 | * @return ResponseInterface |
||
218 | * @throws \yii\base\InvalidConfigException |
||
219 | */ |
||
220 | public function rawHttpBatch( |
||
229 | |||
230 | /** |
||
231 | * @param ContactBatchMutatorInterface $criteria |
||
232 | * @return callable |
||
233 | * @throws \yii\base\InvalidConfigException |
||
234 | */ |
||
235 | public function httpBatchRelay( |
||
243 | |||
244 | /** |
||
245 | * @param array $payload |
||
246 | * @param ConnectionInterface|string|null $connection |
||
247 | * @return callable |
||
248 | * @throws \yii\base\InvalidConfigException |
||
249 | */ |
||
250 | public function rawHttpBatchRelay( |
||
265 | } |
||
266 |