Completed
Push — develop ( 1d947e...a9d8b7 )
by Nate
05:38
created

ContactListCriteria::read()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 8
cp 0
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 2
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\hubspot\HubSpot;
12
use flipbox\hubspot\services\resources\Companies;
13
use flipbox\hubspot\transformers\collections\DynamicTransformerCollection;
14
use flipbox\hubspot\transformers\DynamicModelSuccess;
15
use flipbox\hubspot\transformers\collections\TransformerCollectionInterface;
16
17
/**
18
 * @author Flipbox Factory <[email protected]>
19
 * @since 1.0.0
20
 */
21
class ContactListCriteria extends ResourceCriteria
22
{
23
    /**
24
     * @param array $config
25
     * @param null $source
26
     * @return mixed
27
     */
28
    public function read(array $config = [], $source = null)
29
    {
30
        $this->prepare($config);
31
32
        return HubSpot::getInstance()
33
            ->getResources()
34
            ->getContactLists()
35
            ->readByCriteria($this, $source);
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41
    public function fetch(array $config = [])
42
    {
43
        return $this->read($config);
44
    }
45
}
46