@@ -133,7 +133,7 @@ protected function syncOS(): PluginJamfDeviceSync
133133 'operatingsystemversions_id ' => $ os_version ->getID (),
134134 'date_creation ' => $ _SESSION ['glpi_currenttime ' ],
135135 ], [
136- 'itemtype ' => $ this ->item ::getType () ,
136+ 'itemtype ' => $ this ->item ::class ,
137137 'items_id ' => $ this ->item ->getID (),
138138 ]);
139139 } catch (Exception ) {
@@ -186,11 +186,11 @@ protected function syncSoftware(): PluginJamfDeviceSync
186186 'is_recursive ' => $ this ->item ->fields ['is_recursive ' ],
187187 ]);
188188 $ this ->applyDesiredState ('Item_SoftwareVersion ' , [
189- 'itemtype ' => $ this ->item ::getType () ,
189+ 'itemtype ' => $ this ->item ::class ,
190190 'items_id ' => $ this ->item ->getID (),
191191 'softwareversions_id ' => $ software_version ->getID (),
192192 ], [
193- 'itemtype ' => $ this ->item ::getType () ,
193+ 'itemtype ' => $ this ->item ::class ,
194194 'items_id ' => $ this ->item ->getID (),
195195 'softwareversions_id ' => $ software_version ->getID (),
196196 'entities_id ' => $ this ->item ->fields ['entities_id ' ],
@@ -206,7 +206,7 @@ protected function syncSoftware(): PluginJamfDeviceSync
206206 foreach ($ to_remove_software as $ to_remove ) {
207207 $ DB ->delete (Item_SoftwareVersion ::getTable (), [
208208 SoftwareVersion ::getTable () . '.softwares_id ' => $ to_remove ['softwares_id ' ],
209- 'itemtype ' => $ this ->item ::getType () ,
209+ 'itemtype ' => $ this ->item ::class ,
210210 'items_id ' => $ this ->item ->getID (),
211211 ], [
212212 'LEFT JOIN ' => [
@@ -294,7 +294,7 @@ protected function syncPurchasing(): PluginJamfDeviceSync
294294 }
295295
296296 $ this ->db ->updateOrInsert (Infocom ::getTable (), $ infocom_changes , [
297- 'itemtype ' => $ this ->item ::getType () ,
297+ 'itemtype ' => $ this ->item ::class ,
298298 'items_id ' => $ this ->item ->getID (),
299299 ]);
300300 } catch (Exception ) {
@@ -312,11 +312,11 @@ protected function syncExtensionAttributes(): PluginJamfDeviceSync
312312 {
313313 if (!$ this ->config ['sync_general ' ] || !isset ($ this ->data ['extension_attributes ' ])) {
314314 $ this ->status ['syncExtensionAttributes ' ] = self ::STATUS_SKIPPED ;
315-
316315 return $ this ;
317- } elseif ($ this ->config ['sync_general ' ] && $ this ->jamfplugin_device === null ) {
318- $ this ->status ['syncExtensionAttributes ' ] = self ::STATUS_DEFERRED ;
316+ }
319317
318+ if ($ this ->jamfplugin_device === null ) {
319+ $ this ->status ['syncExtensionAttributes ' ] = self ::STATUS_DEFERRED ;
320320 return $ this ;
321321 }
322322
@@ -336,7 +336,7 @@ protected function syncExtensionAttributes(): PluginJamfDeviceSync
336336 $ this ->db ->updateOrInsert (PluginJamfItem_ExtensionAttribute ::getTable (), ['value ' => $ attr ['value ' ]], [
337337 'glpi_plugin_jamf_extensionattributes_id ' => $ attr_match ['id ' ],
338338 'items_id ' => $ this ->jamfplugin_device ->getID (),
339- 'itemtype ' => $ this ->jamfplugin_device ::getType () ,
339+ 'itemtype ' => $ this ->jamfplugin_device ::class ,
340340 ]);
341341 }
342342 }
@@ -398,11 +398,11 @@ protected function syncNetwork(): PluginJamfDeviceSync
398398 'comment ' => 'Created by Jamf Plugin for GLPI ' ,
399399 ]);
400400 $ item_wifi = $ this ->createOrGetItem ('Item_DeviceNetworkCard ' , [
401- 'itemtype ' => $ this ->item -> getType () ,
401+ 'itemtype ' => $ this ->item ::class ,
402402 'items_id ' => $ this ->item ->getID (),
403403 'devicenetworkcards_id ' => $ wifi ->getID (),
404404 ], [
405- 'itemtype ' => $ this ->item -> getType () ,
405+ 'itemtype ' => $ this ->item ::class ,
406406 'items_id ' => $ this ->item ->getID (),
407407 'devicenetworkcards_id ' => $ wifi ->getID (),
408408 'is_dynamic ' => 1 ,
@@ -411,12 +411,12 @@ protected function syncNetwork(): PluginJamfDeviceSync
411411 ]);
412412
413413 $ netport = $ this ->createOrGetItem ('NetworkPort ' , [
414- 'itemtype ' => $ this ->item -> getType () ,
414+ 'itemtype ' => $ this ->item ::class ,
415415 'items_id ' => $ this ->item ->getID (),
416416 'instantiation_type ' => 'NetworkPortWifi ' ,
417417 'logical_number ' => 0 ,
418418 ], [
419- 'itemtype ' => $ this ->item -> getType () ,
419+ 'itemtype ' => $ this ->item ::class ,
420420 'items_id ' => $ this ->item ->getID (),
421421 'instantiation_type ' => 'NetworkPortWifi ' ,
422422 'logical_number ' => 0 ,
@@ -442,7 +442,7 @@ protected function syncNetwork(): PluginJamfDeviceSync
442442 'entities_id ' => $ this ->item ->fields ['entities_id ' ],
443443 'itemtype ' => 'NetworkName ' ,
444444 'items_id ' => $ network_name ->getID (),
445- 'mainitemtype ' => $ this ->item -> getType () ,
445+ 'mainitemtype ' => $ this ->item ::class ,
446446 'mainitems_id ' => $ this ->item ->getID (),
447447 'is_dynamic ' => 1 ,
448448 ]);
@@ -451,7 +451,7 @@ protected function syncNetwork(): PluginJamfDeviceSync
451451 'entities_id ' => $ this ->item ->fields ['entities_id ' ],
452452 'itemtype ' => 'NetworkName ' ,
453453 'items_id ' => $ network_name ->getID (),
454- 'mainitemtype ' => $ this ->item -> getType () ,
454+ 'mainitemtype ' => $ this ->item ::class ,
455455 'mainitems_id ' => $ this ->item ->getID (),
456456 'is_dynamic ' => 1 ,
457457 'name ' => $ general ['ip_address ' ],
@@ -500,7 +500,7 @@ protected function syncGeneralJamfPluginItem(): PluginJamfDeviceSync
500500 $ this ->commondevice_changes ['enroll_date ' ] = $ enroll_date ;
501501 }
502502
503- $ this ->commondevice_changes ['itemtype ' ] = $ this ->item ::getType () ;
503+ $ this ->commondevice_changes ['itemtype ' ] = $ this ->item ::class ;
504504 $ this ->commondevice_changes ['items_id ' ] = $ this ->item ->getID ();
505505 $ this ->commondevice_changes ['jamf_items_id ' ] = $ general ['id ' ];
506506 $ this ->commondevice_changes ['udid ' ] = $ general ['udid ' ];
@@ -538,11 +538,11 @@ protected function syncComponents(): PluginJamfDeviceSync
538538 'is_recursive ' => '1 ' ,
539539 ]);
540540 $ this ->applyDesiredState ('Item_DeviceFirmware ' , [
541- 'itemtype ' => $ this ->item ::getType () ,
541+ 'itemtype ' => $ this ->item ::class ,
542542 'items_id ' => $ this ->item ->getID (),
543543 'devicefirmwares_id ' => $ boot_rom ->getID (),
544544 ], [
545- 'itemtype ' => $ this ->item ::getType () ,
545+ 'itemtype ' => $ this ->item ::class ,
546546 'items_id ' => $ this ->item ->getID (),
547547 'devicefirmwares_id ' => $ boot_rom ->getID (),
548548 'is_deleted ' => 0 ,
@@ -558,12 +558,12 @@ protected function syncComponents(): PluginJamfDeviceSync
558558 foreach ($ disk ['partitions ' ] as $ partition ) {
559559 // Volume
560560 $ this ->applyDesiredState (Item_Disk::class, [
561- 'itemtype ' => $ this ->item ::getType () ,
561+ 'itemtype ' => $ this ->item ::class ,
562562 'items_id ' => $ this ->item ->getID (),
563563 'mountpoint ' => '' ,
564564 'name ' => $ partition ['name ' ],
565565 ], [
566- 'itemtype ' => $ this ->item ::getType () ,
566+ 'itemtype ' => $ this ->item ::class ,
567567 'items_id ' => $ this ->item ->getID (),
568568 'name ' => $ partition ['name ' ],
569569 'mountpoint ' => '' ,
@@ -712,7 +712,7 @@ public static function import(string $itemtype, int $jamf_items_id, $use_transac
712712 if ($ items_id ) {
713713 // Link
714714 $ r = $ DB ->insert ('glpi_plugin_jamf_devices ' , [
715- 'itemtype ' => $ item ::getType () ,
715+ 'itemtype ' => $ item ::class ,
716716 'items_id ' => $ items_id ,
717717 'udid ' => $ jamf_item ['general ' ]['udid ' ],
718718 'jamf_type ' => static ::$ jamf_itemtype ,
0 commit comments