<?php
namespace Elements\Bundle\AlpsteinBundle\Model;
use \Pimcore\Model\DataObject;
class AlpsteinTour extends DataObject\AlpsteinTour
{
protected $config;
public function getAlpsteinConfig() {
if (empty($config)) {
$this->config = \Pimcore::getContainer()->getParameter('elements_alpstein_config');
}
return $this->config;
}
public function getAlpsteinGPXDownload() {
$config = $this->getAlpsteinConfig();
return "https://www.outdooractive.com/download.tour.gpx?i=" . $this->getAlpsteinId() . "&project=" . $this->getAlpsteinKey()[0]->getName() . "&key=" . $this->getAlpsteinKey()[0]->getApiKey();
}
public function getAlpsteinKMLDownload() {
$config = $this->getAlpsteinConfig();
return "https://www.outdooractive.com/kml_generate?playlist=1&i=" . $this->getAlpsteinId() . "&project=" . $this->getAlpsteinKey()[0]->getName() . "&key=" . $this->getAlpsteinKey()[0]->getApiKey();
}
public function getAlpsteinLink($projectName = '') {
if ($projectName == "") {
$projectName = 'o' . $this->getAlpsteinKey()[0]->getName();
}
$config = $this->getAlpsteinConfig();
return 'https://regio.outdooractive.com/' . $projectName . '/r/' . $this->getAlpsteinId();
}
}