AAPanelDomain   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 21
c 1
b 0
f 0
dl 0
loc 72
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A Add() 0 8 1
A Delete() 0 9 1
A DeleteMultiple() 0 7 1
A ListSite() 0 7 1
1
<?php
2
3
namespace DevOpsSantana\AAPanel;
4
5
/**
6
 * Class AAPanelDomain
7
 * @package DevOpsSantana\AAPanel
8
 * @author Rogério Santana <https://github.com/devopssantana>
9
 * @since : 2022
10
 */
11
12
class AAPanelDomain extends AAPanelConnect
13
{
14
    /**
15
     * Class Construct
16
     */
17
    public function __construct()
18
    {
19
        parent::__construct();
20
    }
21
22
    /**
23
     * @description List Data Domain
24
     * @param $id
25
     * @return mixed
26
     */
27
    public function ListSite($id): mixed
28
    {
29
        $url = $this->serverUrl .'/data?action=getData&table=domain';
30
        
31
        $this->data['search']  = $id;
32
        $this->data['list']    =  true;
33
        return (parent::Execute($url,$this->data));
34
    }
35
36
    /**
37
     * @description Add Domain
38
     * @param $id
39
     * @param $domain
40
     * @param $addDomain
41
     * @return mixed
42
     */
43
    public function Add($id, $domain, $addDomain): mixed
44
    {
45
        $url = $this->serverUrl .'/site?action=AddDomain';
46
        
47
        $this->data['id']       = $id;
48
        $this->data['webname']  = $domain;
49
        $this->data['domain']   = $addDomain;
50
        return (parent::Execute($url,$this->data));
51
    }
52
53
    /**
54
     * @description Delete Domain
55
     * @param $id
56
     * @param $domain
57
     * @param $deleteDomain
58
     * @return mixed
59
     */
60
    public function Delete($id, $domain, $deleteDomain): mixed
61
    {
62
        $url = $this->serverUrl .'/site?action=DelDomain';
63
        
64
        $this->data['id']       = $id;
65
        $this->data['webname']  = $domain;
66
        $this->data['domain']   = $deleteDomain;
67
        $this->data['port']     = 80;
68
        return (parent::Execute($url,$this->data));
69
    }
70
71
    /**
72
     * @description Delete Multiple Domain
73
     * @param $id
74
     * @param $domainsId
75
     * @return mixed
76
     */
77
    public function DeleteMultiple($id, $domainsId): mixed
78
    {
79
        $url = $this->serverUrl .'/site?action=delete_domain_multiple';
80
        
81
        $this->data['id']          = $id;
82
        $this->data['domains_id']  = $domainsId;
83
        return (parent::Execute($url,$this->data));
84
    }
85
}