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

Method parseOperation

lib/Flow/Operation.php:94–111  ·  view source on GitHub ↗
($operation)

Source from the content-addressed store, hash-verified

92 }
93
94 private function parseOperation($operation): array {
95 $flowOperation = [
96 'datasetId' => 0,
97 'dataloadId' => 0,
98 ];
99
100 if (is_string($operation) && str_starts_with(trim($operation), '{')) {
101 $decodedOperation = json_decode($operation, true);
102 if (is_array($decodedOperation)) {
103 $flowOperation['datasetId'] = (int)($decodedOperation['datasetId'] ?? 0);
104 $flowOperation['dataloadId'] = (int)($decodedOperation['dataloadId'] ?? 0);
105 return $flowOperation;
106 }
107 }
108
109 $flowOperation['datasetId'] = (int)$operation;
110 return $flowOperation;
111 }
112}

Callers 3

onEventMethod · 0.95
flow.jsFile · 0.80
beforeMountFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected