@@ -188,9 +188,9 @@ public function synchronize(
188
188
force: $ force ,
189
189
log: $ log
190
190
);
191
-
191
+
192
192
$ result = $ processResult ['result ' ];
193
-
193
+
194
194
if ($ processResult ['targetId ' ] !== null ) {
195
195
$ synchronizedTargetIds [] = $ processResult ['targetId ' ];
196
196
}
@@ -222,6 +222,9 @@ public function synchronize(
222
222
);
223
223
}
224
224
225
+ $ synchronization ->setTargetLastSynced (new DateTime ());
226
+ $ this ->synchronizationMapper ->update ($ synchronization );
227
+
225
228
// Calculate execution time in milliseconds
226
229
$ executionTime = round ((microtime (true ) - $ startTime ) * 1000 );
227
230
$ log ->setExecutionTime ($ executionTime );
@@ -2056,23 +2059,23 @@ private function xmlToArray(\SimpleXMLElement $xml): array
2056
2059
* @param bool $isTest Whether this is a test run
2057
2060
* @param bool $force Whether to force synchronization regardless of changes
2058
2061
* @param SynchronizationLog $log The synchronization log
2059
- *
2062
+ *
2060
2063
* @return array Contains updated result data and the targetId ['result' => array, 'targetId' => string|null]
2061
2064
*/
2062
2065
private function processSynchronizationObject (
2063
- Synchronization $ synchronization ,
2064
- array $ object ,
2065
- array $ result ,
2066
- bool $ isTest ,
2067
- bool $ force ,
2066
+ Synchronization $ synchronization ,
2067
+ array $ object ,
2068
+ array $ result ,
2069
+ bool $ isTest ,
2070
+ bool $ force ,
2068
2071
SynchronizationLog $ log
2069
2072
): array {
2070
2073
// We can only deal with arrays (based on the source empty values or string might be returned)
2071
2074
if (is_array ($ object ) === false ) {
2072
2075
$ result ['objects ' ]['invalid ' ]++;
2073
2076
return ['result ' => $ result , 'targetId ' => null ];
2074
2077
}
2075
-
2078
+
2076
2079
$ conditionsObject = $ this ->encodeArrayKeys ($ object , '. ' , '. ' );
2077
2080
2078
2081
// Check if object adheres to conditions.
@@ -2088,7 +2091,7 @@ private function processSynchronizationObject(
2088
2091
2089
2092
// Get the synchronization contract for this object
2090
2093
$ synchronizationContract = $ this ->synchronizationContractMapper ->findSyncContractByOriginId (
2091
- synchronizationId: $ synchronization ->id ,
2094
+ synchronizationId: $ synchronization ->id ,
2092
2095
originId: $ originId
2093
2096
);
2094
2097
@@ -2108,9 +2111,9 @@ private function processSynchronizationObject(
2108
2111
);
2109
2112
2110
2113
$ synchronizationContract = $ synchronizationContractResult ['contract ' ];
2111
- $ result ['contracts ' ][] = isset ($ synchronizationContractResult ['contract ' ]['uuid ' ]) ?
2114
+ $ result ['contracts ' ][] = isset ($ synchronizationContractResult ['contract ' ]['uuid ' ]) ?
2112
2115
$ synchronizationContractResult ['contract ' ]['uuid ' ] : null ;
2113
- $ result ['logs ' ][] = isset ($ synchronizationContractResult ['log ' ]['uuid ' ]) ?
2116
+ $ result ['logs ' ][] = isset ($ synchronizationContractResult ['log ' ]['uuid ' ]) ?
2114
2117
$ synchronizationContractResult ['log ' ]['uuid ' ] : null ;
2115
2118
$ result ['objects ' ]['created ' ]++;
2116
2119
} else {
@@ -2125,15 +2128,15 @@ private function processSynchronizationObject(
2125
2128
);
2126
2129
2127
2130
$ synchronizationContract = $ synchronizationContractResult ['contract ' ];
2128
- $ result ['contracts ' ][] = isset ($ synchronizationContractResult ['contract ' ]['uuid ' ]) === true ?
2131
+ $ result ['contracts ' ][] = isset ($ synchronizationContractResult ['contract ' ]['uuid ' ]) === true ?
2129
2132
$ synchronizationContractResult ['contract ' ]['uuid ' ] : null ;
2130
- $ result ['logs ' ][] = isset ($ synchronizationContractResult ['log ' ]['uuid ' ]) === true ?
2133
+ $ result ['logs ' ][] = isset ($ synchronizationContractResult ['log ' ]['uuid ' ]) === true ?
2131
2134
$ synchronizationContractResult ['log ' ]['uuid ' ] : null ;
2132
2135
$ result ['objects ' ]['updated ' ]++;
2133
2136
}
2134
2137
2135
2138
$ targetId = $ synchronizationContract ['targetId ' ] ?? null ;
2136
-
2139
+
2137
2140
return ['result ' => $ result , 'targetId ' => $ targetId ];
2138
2141
}
2139
2142
0 commit comments