isPost()) { throw new BadRequest(); } $entity = $this->getRecordService()->convert($data['id'], $data['records']); if (!empty($entity)) { return $entity->toArray(); } throw new Error(); } }