public function getFromWebserviceImport($wsElement, $document = null, $params = [], $idMapper = null)
{
$data = $wsElement->value;
if ($data->id !== null) {
$this->id = $data->id;
if (is_numeric($this->id)) {
$this->snippet = Document\Snippet::getById($this->id);
if (!$this->snippet instanceof Document\Snippet) {
throw new \Exception("cannot get values from web service import - referenced snippet with id [ " . $this->id . " ] is unknown");
}
} else {
throw new \Exception("cannot get values from web service import - id is not valid");
}
}
}