Completed
Push — master ( e78df8...6c6364 )
by Nate
26:21 queued 16:45
created

TimelineEventAccessor::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/hubspot/license
6
 * @link       https://www.flipboxfactory.com/software/hubspot/
7
 */
8
9
namespace flipbox\hubspot\criteria;
10
11
use flipbox\ember\helpers\ObjectHelper;
12
use flipbox\hubspot\HubSpot;
13
use yii\base\BaseObject;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 1.0.0
18
 */
19
class TimelineEventAccessor extends BaseObject implements TimelineEventAccessorInterface
20
{
21
    use traits\TransformerCollectionTrait,
22
        traits\IntegrationConnectionTrait,
23
        traits\CacheTrait;
24
25
    /**
26
     * The event Id
27
     *
28
     * @var string
29
     */
30
    public $id;
31
32
    /**
33
     * The event type Id
34
     *
35
     * @var string
36
     */
37
    public $typeId;
38
39
    /**
40
     * @return string
41
     */
42
    public function getTypeId(): string
43
    {
44
        return $this->typeId;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getId(): string
51
    {
52
        return (string)$this->id;
53
    }
54
55
    /**
56
     * @param array $config
57
     * @param null $source
58
     * @return mixed
59
     * @throws \yii\base\InvalidConfigException
60
     */
61
    public function read(array $config = [], $source = null)
62
    {
63
        $this->prepare($config);
64
        return HubSpot::getInstance()->getResources()->getTimelineEvents()->read($this, $source);
65
    }
66
67
    /**
68
     * @inheritdoc
69
     */
70
    protected function prepare(array $criteria = [])
71
    {
72
        ObjectHelper::populate(
73
            $this,
74
            $criteria
75
        );
76
    }
77
}
78