public function toArray($depth = null)
{
$result = [];
$result['type'] = $this->getType();
$result['webspace'] = $this->getWebspace()->getKey();
$result['url'] = $this->getUrl();
$result['main'] = $this->isMain();
$result['priority'] = $this->getPriority();
$portal = $this->getPortal();
if ($portal) {
$result['portal'] = $portal->getKey();
}
$localization = $this->getLocalization();
if ($localization) {
$result['localization'] = $localization->toArray();
}
$result['redirect'] = $this->getRedirect();
$segment = $this->getSegment();
if ($segment) {
$result['segment'] = $segment->getKey();
}
$analyticsKey = $this->getAnalyticsKey();
if ($analyticsKey) {
$result['analyticsKey'] = $analyticsKey;
}
$urlExpression = $this->getUrlExpression();
if ($urlExpression) {
$result['urlExpression'] = $urlExpression;
}
return $result;
}