1 | <?php |
||
17 | |||
18 | class SyncItemFrom extends AbstractIntegrationItemAction |
||
19 | { |
||
20 | /** |
||
21 | * @inheritdoc |
||
22 | */ |
||
23 | public function getTriggerLabel(): string |
||
27 | |||
28 | /** |
||
29 | * @inheritdoc |
||
30 | */ |
||
31 | public function getConfirmationMessage() |
||
35 | |||
36 | /** |
||
37 | * @param Integrations $field |
||
38 | * @param ElementInterface $element |
||
39 | * @param IntegrationAssociation $record |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function performAction(Integrations $field, ElementInterface $element, IntegrationAssociation $record): bool |
||
43 | { |
||
44 | if (!$field instanceof ObjectsFieldInterface) { |
||
45 | $this->setMessage("Invalid field type."); |
||
46 | return false; |
||
47 | } |
||
48 | |||
49 | if (!$field->syncFromHubSpot($element)) { |
||
50 | $this->setMessage("Failed to sync from HubSpot Object"); |
||
58 |