ArticleTranslation::getBody()   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\Model\Article;
5
6
use Yproximite\Api\Model\ModelInterface;
7
8
/**
9
 * Class ArticleTranslation
10
 */
11
class ArticleTranslation implements ModelInterface
12
{
13
    /**
14
     * @var string
15
     */
16
    private $locale;
17
18
    /**
19
     * @var string
20
     */
21
    private $title;
22
23
    /**
24
     * @var string|null
25
     */
26
    private $body;
27
28
    /**
29
     * @var string
30
     */
31
    private $slug;
32
33
    /**
34
     * ArticleTranslation constructor.
35
     *
36
     * @param array $data
37
     */
38
    public function __construct(array $data)
39
    {
40
        $this->locale = (string) $data['locale'];
41
        $this->title  = (string) $data['title'];
42
        $this->body   = !empty($data['body']) ? (string) $data['body'] : null;
43
        $this->slug   = (string) $data['slug'];
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getLocale(): string
50
    {
51
        return $this->locale;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getTitle(): string
58
    {
59
        return $this->title;
60
    }
61
62
    /**
63
     * @return null|string
64
     */
65
    public function getBody()
66
    {
67
        return $this->body;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getSlug(): string
74
    {
75
        return $this->slug;
76
    }
77
}
78