@@ 39-56 (lines=18) @@ | ||
36 | */ |
|
37 | protected $value; |
|
38 | ||
39 | public function __construct(array $fieldData = []) |
|
40 | { |
|
41 | if (isset($fieldData['id'])) { |
|
42 | $this->id = $fieldData['id']; |
|
43 | } |
|
44 | if (isset($fieldData['contact_id'])) { |
|
45 | $this->contactId = $fieldData['contact_id']; |
|
46 | } |
|
47 | if (isset($fieldData['name'])) { |
|
48 | $this->name = $fieldData['name']; |
|
49 | } |
|
50 | if (isset($fieldData['type'])) { |
|
51 | $this->type = $fieldData['type']; |
|
52 | } |
|
53 | if (isset($fieldData['value'])) { |
|
54 | $this->value = $fieldData['value']; |
|
55 | } |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * @return array |
@@ 38-55 (lines=18) @@ | ||
35 | * @param array $customData |
|
36 | * @param int $leadId |
|
37 | */ |
|
38 | public function __construct(array $customData = [], $leadId = 0) |
|
39 | { |
|
40 | if (isset($customData['id'])) { |
|
41 | $this->id = (int) $customData['id']; |
|
42 | } |
|
43 | if (isset($customData['type'])) { |
|
44 | $this->type = $customData['type']; |
|
45 | } |
|
46 | if (isset($customData['name'])) { |
|
47 | $this->name = $customData['name']; |
|
48 | } |
|
49 | if (isset($customData['value'])) { |
|
50 | $this->value = $customData['value']; |
|
51 | } |
|
52 | if ($leadId > 0) { |
|
53 | $this->leadId = $leadId; |
|
54 | } |
|
55 | } |
|
56 | ||
57 | /** |
|
58 | * @return array |