Code Duplication    Length = 73-83 lines in 4 locations

htdocs/src/Oc/Country/CountryEntity.php 1 location

@@ 10-92 (lines=83) @@
7
 *
8
 * @package Oc\Country
9
 */
10
class CountryEntity
11
{
12
    /**
13
     * @var string
14
     */
15
    public $short;
16
17
    /**
18
     * @var string
19
     */
20
    public $name;
21
22
    /**
23
     * @var string
24
     */
25
    public $de;
26
27
    /**
28
     * @var string
29
     */
30
    public $en;
31
32
    /**
33
     * @var int
34
     */
35
    public $translationId;
36
37
    /**
38
     * @var bool
39
     */
40
    public $listDefaultDe;
41
42
    /**
43
     * @var bool
44
     */
45
    public $listDefaultEn;
46
47
    /**
48
     * @var string
49
     */
50
    public $sortDe;
51
52
    /**
53
     * @var string
54
     */
55
    public $sortEn;
56
57
    /**
58
     * Checks if the entity is new.
59
     *
60
     * @return bool
61
     */
62
    public function isNew()
63
    {
64
        return $this->short === null;
65
    }
66
67
    /**
68
     * Sets all properties from array.
69
     *
70
     * @param array $data
71
     */
72
    public function fromArray(array $data)
73
    {
74
        foreach ($data as $key => $value) {
75
            if (!property_exists($this, $key)) {
76
                continue;
77
            }
78
79
            $this->{$key} = $value;
80
        }
81
    }
82
83
    /**
84
     * Returns all properties as array.
85
     *
86
     * @return array
87
     */
88
    public function toArray()
89
    {
90
        return get_object_vars($this);
91
    }
92
}
93

htdocs/src/Oc/Language/LanguageEntity.php 1 location

@@ 10-92 (lines=83) @@
7
 *
8
 * @package Oc\Language
9
 */
10
class LanguageEntity
11
{
12
    /**
13
     * @var string
14
     */
15
    public $short;
16
17
    /**
18
     * @var string
19
     */
20
    public $name;
21
22
    /**
23
     * @var string
24
     */
25
    public $nativeName;
26
27
    /**
28
     * @var string
29
     */
30
    public $de;
31
32
    /**
33
     * @var string
34
     */
35
    public $en;
36
37
    /**
38
     * @var int
39
     */
40
    public $translationId;
41
42
    /**
43
     * @var bool
44
     */
45
    public $listDefaultDe;
46
47
    /**
48
     * @var bool
49
     */
50
    public $listDefaultEn;
51
52
    /**
53
     * @var bool
54
     */
55
    public $isTranslated;
56
57
    /**
58
     * Checks if the entity is new.
59
     *
60
     * @return bool
61
     */
62
    public function isNew()
63
    {
64
        return $this->short === null;
65
    }
66
67
    /**
68
     * Sets all properties from array.
69
     *
70
     * @param array $data
71
     */
72
    public function fromArray(array $data)
73
    {
74
        foreach ($data as $key => $value) {
75
            if (!property_exists($this, $key)) {
76
                continue;
77
            }
78
79
            $this->{$key} = $value;
80
        }
81
    }
82
83
    /**
84
     * Returns all properties as array.
85
     *
86
     * @return array
87
     */
88
    public function toArray()
89
    {
90
        return get_object_vars($this);
91
    }
92
}
93

htdocs/src/Oc/Page/BlockEntity.php 1 location

@@ 12-84 (lines=73) @@
9
 *
10
 * @package Oc\Page
11
 */
12
class BlockEntity
13
{
14
    /**
15
     * @var int
16
     */
17
    public $id;
18
19
    /**
20
     * @var int
21
     */
22
    public $pageId;
23
24
    /**
25
     * @var string
26
     */
27
    public $title;
28
29
    /**
30
     * @var string
31
     */
32
    public $html;
33
34
    /**
35
     * @var int
36
     */
37
    public $position;
38
39
    /**
40
     * @var DateTime
41
     */
42
    public $updatedAt;
43
44
    /**
45
     * @var bool
46
     */
47
    public $active;
48
49
    /**
50
     * Checks if the entity is new.
51
     *
52
     * @return bool
53
     */
54
    public function isNew()
55
    {
56
        return $this->id === null;
57
    }
58
59
    /**
60
     * Sets all properties from array.
61
     *
62
     * @param array $data
63
     */
64
    public function fromArray(array $data)
65
    {
66
        foreach ($data as $key => $value) {
67
            if (!property_exists($this, $key)) {
68
                continue;
69
            }
70
71
            $this->{$key} = $value;
72
        }
73
    }
74
75
    /**
76
     * Returns all properties as array.
77
     *
78
     * @return array
79
     */
80
    public function toArray()
81
    {
82
        return get_object_vars($this);
83
    }
84
}
85

htdocs/src/Oc/Page/PageEntity.php 1 location

@@ 12-84 (lines=73) @@
9
 *
10
 * @package Oc\Page
11
 */
12
class PageEntity
13
{
14
    /**
15
     * @var int
16
     */
17
    public $id;
18
19
    /**
20
     * @var string
21
     */
22
    public $slug;
23
24
    /**
25
     * @var string
26
     */
27
    public $metaKeywords;
28
29
    /**
30
     * @var string
31
     */
32
    public $metaDescription;
33
34
    /**
35
     * @var string
36
     */
37
    public $metaSocial;
38
39
    /**
40
     * @var DateTime
41
     */
42
    public $updatedAt;
43
44
    /**
45
     * @var bool
46
     */
47
    public $active = true;
48
49
    /**
50
     * Checks if the entity is new.
51
     *
52
     * @return bool
53
     */
54
    public function isNew()
55
    {
56
        return $this->id === null;
57
    }
58
59
    /**
60
     * Sets all properties from array.
61
     *
62
     * @param array $data
63
     */
64
    public function fromArray(array $data)
65
    {
66
        foreach ($data as $key => $value) {
67
            if (!property_exists($this, $key)) {
68
                continue;
69
            }
70
71
            $this->{$key} = $value;
72
        }
73
    }
74
75
    /**
76
     * Returns all properties as array.
77
     *
78
     * @return array
79
     */
80
    public function toArray()
81
    {
82
        return get_object_vars($this);
83
    }
84
}
85