Completed
Push — master ( 20c412...48d54d )
by Vítězslav
05:37
created

Changes::getStatus()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
/**
3
 * FlexiPeeHP - Objekt záznamu změn.
4
 *
5
 * @author     Vítězslav Dvořák <[email protected]>
6
 * @copyright  (C) 2016 Spoje.Net
7
 */
8
9
namespace FlexiPeeHP;
10
11
class Changes extends FlexiBee
12
{
13
    /**
14
     * Evidence užitá objektem.
15
     *
16
     * @var string
17
     */
18
    public $evidence = 'changes';
19
20
    /**
21
     * Povolí oznamování změn
22
     * @return type
23
     */
24
    public function enable()
25
    {
26
        $this->performRequest('changes/enable.xml', 'POST', 'xml');
27
        return $this->lastResponseCode == 200;
28
    }
29
30
    /**
31
     * Zakáže oznamování změn
32
     * @return type
33
     */
34
    public function disable()
35
    {
36
        $this->performRequest('changes/disable.xml', 'POST', 'xml');
37
        return $this->lastResponseCode == 200;
38
    }
39
40
    /**
41
     * Vrátí stav zapnutí ChangesAPI
42
     *
43
     * @return boolan
44
     */
45
    public function getStatus()
46
    {
47
        $status = $this->performRequest('changes/status.xml', 'GET', 'xml');
48
        return (($this->lastResponseCode == 200) && ($status['success'] == 'true'));
49
    }
50
}