1 | <?php |
||
26 | class ObjectAssociation extends IntegrationAssociation |
||
27 | { |
||
28 | /** |
||
29 | * The table alias |
||
30 | */ |
||
31 | const TABLE_ALIAS = 'hubspot_objects'; |
||
32 | |||
33 | /** |
||
34 | * @inheritdoc |
||
35 | * @throws \Throwable |
||
36 | */ |
||
37 | public function __construct($config = []) |
||
38 | { |
||
39 | HubSpot::getInstance()->getObjectAssociations()->ensureTableExists(); |
||
40 | parent::__construct($config); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 3 | public static function tableAlias() |
|
47 | { |
||
48 | 3 | return parent::tableAlias() . HubSpot::getInstance()->getSettings()->environmentTablePostfix; |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * @inheritdoc |
||
53 | * @return ObjectAssociations |
||
54 | */ |
||
55 | protected function associationService(): SortableAssociations |
||
56 | { |
||
57 | return HubSpot::getInstance()->getObjectAssociations(); |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @noinspection PhpDocMissingThrowsInspection |
||
62 | * @return ObjectAssociationQuery |
||
63 | */ |
||
64 | public static function find(): ObjectAssociationQuery |
||
70 | |||
71 | /** |
||
72 | * @param array $criteria |
||
73 | * @return mixed|null |
||
74 | * @throws \yii\base\InvalidConfigException |
||
75 | */ |
||
76 | public function getObject(array $criteria = []) |
||
106 | } |
||
107 |