AbstractCompanyMessage::getParentId()   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 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Yproximite\Api\Message\Company;
5
6
use Yproximite\Api\Message\MessageInterface;
7
8
/**
9
 * Class AbstractCompanyMessage
10
 */
11
abstract class AbstractCompanyMessage implements MessageInterface
12
{
13
    /**
14
     * @var string
15
     */
16
    private $name;
17
18
    /**
19
     * @var int|null
20
     */
21
    private $parentId;
22
23
    /**
24
     * @return string
25
     */
26
    public function getName(): string
27
    {
28
        return $this->name;
29
    }
30
31
    /**
32
     * @param string $name
33
     */
34
    public function setName(string $name)
35
    {
36
        $this->name = $name;
37
    }
38
39
    /**
40
     * @return int|null
41
     */
42
    public function getParentId()
43
    {
44
        return $this->parentId;
45
    }
46
47
    /**
48
     * @param int|null $parentId
49
     */
50
    public function setParentId(int $parentId = null)
51
    {
52
        $this->parentId = $parentId;
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function build()
59
    {
60
        return [
61
            'companyName' => $this->getName(),
62
            'parent'      => $this->getParentId(),
63
        ];
64
    }
65
}
66