* Get the number of records for a dataset * @param int $datasetId * @param string|null $user_id * @return array */
(int $datasetId, ?string $user_id = null)
| 288 | * @return array |
| 289 | */ |
| 290 | public function getRecordCount(int $datasetId, ?string $user_id = null) { |
| 291 | if ($this->DatasetStorageResolver->resolve($datasetId)['mode'] === DatasetStorageResolver::FLEXIBLE_SHARED) { |
| 292 | return $this->FlexibleStorageService->getRecordCount($datasetId); |
| 293 | } |
| 294 | return $this->StorageMapper->getRecordCount($datasetId, $user_id); |
| 295 | } |
| 296 | |
| 297 | private function requireLegacy(int $datasetId): void { |
| 298 | $mode = $this->DatasetStorageResolver->resolve($datasetId)['mode']; |