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

Method apiValue

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

Source from the content-addressed store, hash-verified

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

Callers 2

queryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected