public function getFieldData(VersionInfo $versionInfo, Field $field, array $context)
{
$id = $field->value->data['urlId'];
if (empty($id)) {
$field->value->externalData = null;
return;
}
/** @var \eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway $gateway */
$gateway = $this->getGateway($context);
$map = $gateway->getIdUrlMap(array($id));
// URL id is not in the DB
if (!isset($map[$id]) && isset($this->logger)) {
$this->logger->error("URL with ID '{$id}' not found");
}
$field->value->externalData = isset($map[$id]) ? $map[$id] : '';
}