Completed
Push — master ( b2db07...6ada9a )
by luca
08:41
created

UserListClient::setUserlistname()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
4
namespace Audiens\DoubleclickClient\entity;
5
6
use GiacomoFurlan\ObjectTransmapperValidator\Annotation\Validation\Validate;
7
8
class UserListClient
9
{
10
    use TransmapHydratable;
11
12
    const STATUS_ACTIVE = 'ACTIVE';
13
    const STATUS_INACTIVE = 'INACTIVE';
14
    const STATUS_UNKNOWN = 'UNKNOWN';
15
16
    /**
17
     * @var string
18
     * @Validate(type="string", mandatory=true)
19
     */
20
    protected $userlistid;
21
22
    /**
23
     * @var string
24
     * @Validate(type="string", mandatory=false)
25
     */
26
    protected $clientcustomername;
27
28
    /**
29
     * @var string
30
     * @Validate(type="string", mandatory=true)
31
     */
32
    protected $status;
33
34
    /**
35
     * @var string
36
     * @Validate(type="string", mandatory=false)
37
     */
38
    protected $userlistname;
39
40
    /**
41
     * @var  UserListPricing
42
     * @Validate(type="Audiens\DoubleclickClient\entity\UserListPricing", mandatory=false)
43
     */
44
    protected $pricingInfo;
45
46
    /**
47
     * @var string
48
     * @see Product::*
49
     * @Validate(type="string", mandatory=true)
50
     */
51
    protected $clientproduct;
52
53
    /**
54
     * @var string
55
     * @Validate(type="string", mandatory=true)
56
     */
57
    protected $clientid;
58
59
    /**
60
     * @return string
61
     */
62
    public function getUserlistid()
63
    {
64
        return $this->userlistid;
65
    }
66
67
    /**
68
     * @param int $userlistid
69
     */
70
    public function setUserlistid($userlistid)
71
    {
72
        $this->userlistid = $userlistid;
0 ignored issues
show
Documentation Bug introduced by
The property $userlistid was declared of type string, but $userlistid is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
73
    }
74
75
    /**
76
     * @return string
77
     */
78
    public function getClientcustomername()
79
    {
80
        return $this->clientcustomername;
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getStatus()
87
    {
88
        return $this->status;
89
    }
90
91
    /**
92
     * @param string $status
93
     */
94
    public function setStatus($status)
95
    {
96
        $this->status = $status;
97
    }
98
99
    /**
100
     * @return string
101
     */
102
    public function getUserlistname()
103
    {
104
        return $this->userlistname;
105
    }
106
107
    /**
108
     * @param string $userlistname
109
     */
110
    public function setUserlistname($userlistname)
111
    {
112
        $this->userlistname = $userlistname;
113
    }
114
115
    /**
116
     * @return UserListPricing
117
     */
118
    public function getPricingInfo()
119
    {
120
        return $this->pricingInfo;
121
    }
122
123
    /**
124
     * @param UserListPricing $pricingInfo
125
     */
126
    public function setPricingInfo(UserListPricing $pricingInfo)
127
    {
128
        $this->pricingInfo = $pricingInfo;
129
    }
130
131
    /**
132
     * @return string
133
     */
134
    public function getClientproduct()
135
    {
136
        return $this->clientproduct;
137
    }
138
139
    /**
140
     * @param string $clientproduct
141
     */
142
    public function setClientproduct($clientproduct)
143
    {
144
        $this->clientproduct = $clientproduct;
145
    }
146
147
    /**
148
     * @return int
149
     */
150
    public function getClientid()
151
    {
152
        return $this->clientid;
153
    }
154
155
    /**
156
     * @param string $clientid
157
     */
158
    public function setClientid($clientid)
159
    {
160
        $this->clientid = $clientid;
161
    }
162
163
    protected static function hydratePreprocess(array $objectArray): array
164
    {
165
        if (array_key_exists('pricingInfo', $objectArray)) {
166
            $objectArray['pricingInfo'] = (object)$objectArray['pricingInfo'];
167
        }
168
169
        $intArray = [
170
            'userlistid',
171
            'clientid'
172
        ];
173
174
        foreach ($intArray as $key) {
175
            if (is_int($objectArray[$key])) {
176
                $objectArray[$key] = (string)$objectArray[$key];
177
            }
178
        }
179
180
        if (isset($objectArray['clientcustomername']) && is_array($objectArray['clientcustomername'])) {
181
            $objectArray['clientcustomername'] = implode(',', $objectArray['clientcustomername']);
182
        }
183
184
        return $objectArray;
185
    }
186
}
187