Completed
Push — master ( aee67f...179ee3 )
by
unknown
01:43
created

Zanox::getMerchants()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Padosoft\AffiliateNetwork\Networks;
4
5
use Padosoft\AffiliateNetwork\AbstractNetwork;
6
use Padosoft\AffiliateNetwork\NetworkInterface;
7
8
/**
9
 * Class Zanox
10
 * @package Padosoft\AffiliateNetwork\Networks
11
 */
12
class Zanox extends AbstractNetwork implements NetworkInterface
13
{
14
    /**
15
     * @var object
16
     */
17
    private $_network = null;
18
19
    /**
20
     * @method __construct
21
     */
22
    public function __construct(string $username, string $password)
23
    {
24
        $this->_network = new \Oara\Network\Publisher\Zanox;
25
        $this->username = $username;
26
        $this->password = $password;
27
    }
28
29
    /**
30
     * @return bool
31
     */
32
    public function checkLogin() : bool
33
    {
34
        $credentials = array();
35
        $credentials["connectid"] = $this->username;
36
        $credentials["secretkey"] = $this->password;
37
        $this->_network->login($credentials);
38
        if ($this->_network->checkConnection()) {
39
            return true;
40
        }
41
        
42
        return false;
43
    }
44
45
    /**
46
     * @return array of Merchants
47
     */
48
    public function getMerchants() : array
49
    {
50
        return $this->_network->getMerchantList();
51
    }
52
53
    /**
54
     * @param \DateTime $dateFrom
55
     * @param \DateTime $dateTo
56
     * @param int $merchantID
57
     * @return array of Deal
58
     */
59
    public function getDeals(\DateTime $dateFrom, \DateTime $dateTo, int $merchantID = 0) : array
60
    {
61
        // TODO: Implement getDeals() method.
62
    }
63
64
    /**
65
     * @param \DateTime $dateFrom
66
     * @param \DateTime $dateTo
67
     * @param int $merchantID
68
     * @return array of Transaction
69
     */
70
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, int $merchantID = 0) : array
71
    {
72
        // TODO: Implement getSales() method.
73
    }
74
75
    /**
76
     * @param \DateTime $dateFrom
77
     * @param \DateTime $dateTo
78
     * @param int $merchantID
79
     * @return array of Stat
80
     */
81
    public function getStats(\DateTime $dateFrom, \DateTime $dateTo, int $merchantID = 0) : array
82
    {
83
        // TODO: Implement getStats() method.
84
    }
85
}
86