<?php class EnrolleeViewHelper extends ViewHelper implements ViewHelperInterface { public function objectToArray(mixed $object): array { if (get_class($object) !== 'Enrollee') { throw new Exception('Этот класс принимает только объекты класса Enrollee.'); } $listFields = $this->getListFields($object); $result = []; foreach ($listFields as $field) { $valueField = isset($object->$field) ? $object->get($field) : ""; $valueField = $this->escapeMetacharacters($valueField); $result [] = $valueField; } return $result; } }
You have javascript disabled. You will not be able to edit any code.