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( |
||
200 | |||
201 | /******************************************* |
||
202 | * BATCH |
||
203 | *******************************************/ |
||
204 | |||
205 | |||
206 | /** |
||
207 | * @param ContactBatchMutatorInterface $criteria |
||
208 | * @return ResponseInterface |
||
209 | * @throws \yii\base\InvalidConfigException |
||
210 | */ |
||
211 | public function httpBatch( |
||
219 | |||
220 | /** |
||
221 | * @param array $payload |
||
222 | * @param ConnectionInterface|string|null $connection |
||
223 | * @return ResponseInterface |
||
224 | * @throws \yii\base\InvalidConfigException |
||
225 | */ |
||
226 | public function rawHttpBatch( |
||
235 | |||
236 | /** |
||
237 | * @param ContactBatchMutatorInterface $criteria |
||
238 | * @return callable |
||
239 | * @throws \yii\base\InvalidConfigException |
||
240 | */ |
||
241 | public function httpBatchRelay( |
||
249 | |||
250 | /** |
||
251 | * @param array $payload |
||
252 | * @param ConnectionInterface|string|null $connection |
||
253 | * @return callable |
||
254 | * @throws \yii\base\InvalidConfigException |
||
255 | */ |
||
256 | public function rawHttpBatchRelay( |
||
271 | } |
||
272 |