# jetpack/16.3-a.7/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php

Jetpack – WP Security, Backup, Speed, &amp; Growth, version 16.3-a.7. 66 lines.

- Page: https://pluginprobe.com/plugins/jetpack/16.3-a.7/code/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php
- Raw: https://pluginprobe.com/plugins/jetpack/16.3-a.7/raw/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php
- Modified: 2021-12-14T19:26:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetpack/16.3-a.7/code/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php#L10-L20`.

```php
<?php
/**
 * Sync utils.
 *
 * @package automattic/jetpack-sync
 */

namespace Automattic\Jetpack\Sync;

/**
 * Class for sync utilities.
 */
class Utils {
	/**
	 * Retrieve the values of sync items.
	 *
	 * @access public
	 * @static
	 *
	 * @param array $items Array of sync items.
	 * @return array Array of sync item values.
	 */
	public static function get_item_values( $items ) {
		return array_map( array( __CLASS__, 'get_item_value' ), $items );
	}

	/**
	 * Retrieve the IDs of sync items.
	 *
	 * @access public
	 * @static
	 *
	 * @param array $items Array of sync items.
	 * @return array Array of sync item IDs.
	 */
	public static function get_item_ids( $items ) {
		return array_map( array( __CLASS__, 'get_item_id' ), $items );
	}

	/**
	 * Get the value of a sync item.
	 *
	 * @access private
	 * @static
	 *
	 * @param array $item Sync item.
	 * @return mixed Sync item value.
	 */
	private static function get_item_value( $item ) {
		return $item->value;
	}

	/**
	 * Get the ID of a sync item.
	 *
	 * @access private
	 * @static
	 *
	 * @param array $item Sync item.
	 * @return int Sync item ID.
	 */
	private static function get_item_id( $item ) {
		return $item->id;
	}
}

```
