MCPcopy Create free account
hub / github.com/Rello/analytics / apiValue

Method apiValue

lib/Service/FlexibleStorageService.php:1118–1132  ·  view source on GitHub ↗
(array $column, mixed $value, bool $aggregate, string $aggregation)

Source from the content-addressed store, hash-verified

1116 }
1117
1118 private function apiValue(array $column, mixed $value, bool $aggregate, string $aggregation): mixed {
1119 if ($value === null) {
1120 return null;
1121 }
1122 if ($aggregate && $column['role'] === 'measure') {
1123 return (string)$value;
1124 }
1125 return match ($column['type']) {
1126 'decimal' => (string)$value,
1127 'boolean' => (string)$value === '1',
1128 'date' => substr((string)$value, 0, 10),
1129 'datetime' => str_replace(' ', 'T', substr((string)$value, 0, 19)) . 'Z',
1130 default => (string)$value,
1131 };
1132 }
1133
1134 /** @return list<array<string,mixed>> */
1135 private function normalizeColumns(array $columns): array {

Callers 2

queryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected