| 219 | } |
| 220 | |
| 221 | public function getLastUpdate(int $datasetId): int { |
| 222 | $sql = $this->db->getQueryBuilder(); |
| 223 | $sql->selectAlias($sql->func()->max('updated_at'), 'updated_at') |
| 224 | ->from(self::RECORD_TABLE) |
| 225 | ->where($sql->expr()->eq('dataset_id', $sql->createNamedParameter($datasetId, IQueryBuilder::PARAM_INT))); |
| 226 | $value = $sql->executeQuery()->fetchOne(); |
| 227 | return $value === false || $value === null ? 0 : (int)strtotime((string)$value . ' UTC'); |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * @param list<array<string,mixed>> $projection |