| Conditions | 5 |
| Paths | 5 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 120 | public function toAPI(array $exclude = [], $clean = true) |
||
| 121 | { |
||
| 122 | $data = [ |
||
| 123 | "contact_list_id" => $this->getContactListId(), |
||
| 124 | "name" => $this->getName(), |
||
| 125 | "cql" => $this->getCql(), |
||
| 126 | ]; |
||
| 127 | |||
| 128 | if ($clean) { |
||
| 129 | foreach ($data as $key => $value) { |
||
| 130 | if (empty($value)) { |
||
| 131 | unset($data[$key]); |
||
| 132 | } |
||
| 133 | } |
||
| 134 | } |
||
| 135 | |||
| 136 | foreach ($exclude as $field) { |
||
| 137 | unset($data[$field]); |
||
| 138 | } |
||
| 139 | |||
| 140 | return $data; |
||
| 141 | } |
||
| 142 | |||
| 165 |