| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function toArray(Template $object, $fields = []) |
||
| 18 | { |
||
| 19 | $array = [ |
||
| 20 | "id" => $object->getId(), |
||
| 21 | "nom" => $object->getNom(), |
||
| 22 | "type" => $object->getType(), |
||
| 23 | "sujet" => $object->getSujet(), |
||
| 24 | "message" => $object->getMessage(), |
||
| 25 | ]; |
||
| 26 | if(empty($fields)){ |
||
| 27 | return $array; |
||
| 28 | } |
||
| 29 | $export = []; |
||
| 30 | foreach($fields as $row){ |
||
| 31 | $export[$row] = $array[$row]; |
||
| 32 | } |
||
| 33 | return $export; |
||
| 34 | } |
||
| 35 | } |
||
| 36 |