AAPanelBackup::Delete()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace DevOpsSantana\AAPanel;
4
5
/**
6
 * Class AAPanelBackup
7
 * @package DevOpsSantana\AAPanel
8
 * @author Rogério Santana <https://github.com/devopssantana>
9
 * @since : 2022
10
 */
11
12
class AAPanelBackup extends AAPanelConnect
13
{
14
    /**
15
     * Class Construct
16
     */
17
    public function __construct()
18
    {
19
        parent::__construct();
20
    }
21
22
    /**
23
     * @description List Backup
24
     * @param int $limit
25
     * @param $search
26
     * @return mixed
27
     */
28
    public function List(int $limit = 100, $search = null): mixed
29
    {
30
        $url = $this->serverUrl .'/data?action=getData&table=backup';
31
        
32
        $this->data['limit']   = $limit;
33
        $this->data['type']    = 0;
34
        $this->data['search']  = $search;
35
        return (parent::Execute($url,$this->data));
36
    }
37
38
    /**
39
     * @description Create Backup
40
     * @param $id
41
     * @return mixed
42
     */
43
    public function Create($id): mixed
44
    {
45
        $url = $this->serverUrl .'/site?action=ToBackup';
46
        
47
        $this->data['id']   = $id;
48
        return (parent::Execute($url,$this->data));
49
    }
50
51
    /**
52
     * @description Delete Backup
53
     * @param $id
54
     * @return mixed
55
     */
56
    public function Delete($id): mixed
57
    {
58
        $url = $this->serverUrl .'/site?action=DelBackup';
59
        
60
        $this->data['id']   = $id;
61
        return (parent::Execute($url,$this->data));
62
    }
63
}