Completed
Push — master ( 14dc45...6a7b8b )
by Vítězslav
08:50
created

Changes::recordExists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
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
/**
12
 * Log změn v evidencích
13
 *
14
 * @link https://www.flexibee.eu/api/dokumentace/ref/changes-api/ Dokumentace
15
 */
16
class Changes extends FlexiBeeRO
17
{
18
    /**
19
     * Evidence užitá objektem.
20
     *
21
     * @var string
22
     */
23
    public $evidence = 'changes';
24 1
25
    /**
26 1
     * Povolí oznamování změn
27 1
     * @return type
28
     */
29
    public function enable()
30
    {
31
        $this->performRequest('changes/enable.xml', 'POST', 'xml');
32
        return $this->lastResponseCode == 200;
33
    }
34 1
35
    /**
36 1
     * Zakáže oznamování změn
37 1
     * @return type
38
     */
39
    public function disable()
40
    {
41
        $this->performRequest('changes/disable.xml', 'POST', 'xml');
42
        return $this->lastResponseCode == 200;
43
    }
44
45 1
    /**
46
     * Vrátí stav zapnutí ChangesAPI
47 1
     *
48 1
     * @return boolan
49
     */
50
    public function getStatus()
51
    {
52
        $status = $this->performRequest('changes/status.xml', 'GET', 'xml');
53
        return (($this->lastResponseCode == 200) && ($status['success'] === 'true'));
54
    }
55
56
    /**
57
     * Test if given record exists in FlexiBee .
58
     *
59
     * @param array $data
60
     * @return null Method is disabled for Changes
61
     */
62
    public function recordExists($data = null)
63
    {
64
        return null;
65
    }
66
67
}
68