';
return $table;
}
catch (NotFoundException $e) {
$this->getLog()->error('Request failed for dataSet id=%d. Widget=%d. Due to %s', $dataSetId, $this->getWidgetId(), $e->getMessage());
$this->getLog()->debug($e->getTraceAsString());
return '';
}
}
/**
* Is Valid
* @return int
*/
public function IsValid()
{
// DataSet rendering will be valid
return 1;
}
/** @inheritdoc */
public function getModifiedTimestamp($displayId)
{
$widgetModifiedDt = null;
$dataSetId = $this->getOption('dataSetId');
$dataSet = $this->dataSetFactory->getById($dataSetId);
// Set the timestamp
$widgetModifiedDt = $dataSet->lastDataEdit;
// Remote dataSets are kept "active" by required files
if ($dataSet->isRemote) {
// Touch this dataSet
$dataSetCache = $this->getPool()->getItem('/dataset/accessed/' . $dataSet->dataSetId);
$dataSetCache->set('true');
$dataSetCache->expiresAfter($this->getSetting('REQUIRED_FILES_LOOKAHEAD') * 1.5);
$this->getPool()->saveDeferred($dataSetCache);
}
return $widgetModifiedDt;
}
/** @inheritdoc */
public function getCacheDuration()
{
return $this->getOption('updateInterval', 120) * 60;
}
/** @inheritdoc */
public function getCacheKey($displayId)
{
// DataSetViews are display specific
return $this->getWidgetId() . '_' . $displayId;
}
/** @inheritdoc */
public function getLockKey()
{
// Lock to the dataSetId, because our dataSet might have external images which are downloaded.
return $this->getOption('dataSetId');
}
}