public function getFromWebserviceImport($wsElement, $document = null, $params = [], $idMapper = null) { $data = $wsElement->value; if ($data->text === null or is_string($data->text)) { $this->text = $data->text; } else { throw new \Exception("cannot get values from web service import - invalid data"); } }