1 | <?php |
||
36 | class ObjectAssociations extends IntegrationAssociations |
||
37 | { |
||
38 | /** |
||
39 | * @inheritdoc |
||
40 | * @throws \Throwable |
||
41 | */ |
||
42 | 3 | public function init() |
|
43 | { |
||
44 | 3 | $settings = HubSpot::getInstance()->getSettings(); |
|
45 | 3 | $this->cacheDuration = $settings->associationsCacheDuration; |
|
46 | 3 | $this->cacheDependency = $settings->associationsCacheDependency; |
|
47 | |||
48 | 3 | parent::init(); |
|
49 | |||
50 | 3 | $this->ensureTableExists(); |
|
51 | 3 | } |
|
52 | |||
53 | /** |
||
54 | * @inheritdoc |
||
55 | * @return ObjectsField |
||
56 | */ |
||
57 | protected function fieldService(): IntegrationField |
||
58 | { |
||
59 | return HubSpot::getInstance()->getObjectsField(); |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | protected static function tableAlias(): string |
||
66 | { |
||
67 | return ObjectAssociation::tableAlias(); |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @inheritdoc |
||
72 | */ |
||
73 | public static function recordClass(): string |
||
74 | { |
||
75 | return ObjectAssociation::class; |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @throws \Throwable |
||
80 | */ |
||
81 | 3 | public function ensureTableExists() |
|
91 | |||
92 | /** |
||
93 | * @return bool |
||
94 | * @throws \Throwable |
||
95 | */ |
||
96 | 3 | private function createTable(): bool |
|
104 | } |
||
105 |