MailObject::invokeDelete()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/*
4
 * DirectAdmin API Client
5
 * (c) Omines Internetbureau B.V. - https://omines.nl/
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Omines\DirectAdmin\Objects\Email;
12
13
use Omines\DirectAdmin\Objects\DomainObject;
14
15
/**
16
 * Base class for objects exposing a mail address.
17
 *
18
 * @author Niels Keurentjes <[email protected]>
19
 */
20
abstract class MailObject extends DomainObject
21
{
22
    /**
23
     * Delete the object.
24
     *
25
     * @param string $command Command to execute
26
     * @param string $paramName Parameter name for the delete command
27
     */
28
    protected function invokeDelete($command, $paramName)
29
    {
30
        $this->invokePost($command, 'delete', [$paramName => $this->getPrefix()]);
31
    }
32
33
    /**
34
     * Returns the full email address for this forwarder.
35
     *
36
     * @return string
37
     */
38
    public function getEmailAddress()
39
    {
40
        return $this->getPrefix() . '@' . $this->getDomainName();
41
    }
42
43
    /**
44
     * Returns the domain-agnostic part before the @ in the forwarder.
45
     *
46
     * @return string
47
     */
48
    public function getPrefix()
49
    {
50
        return $this->getName();
51
    }
52
}
53