Users::get_users( null|string $account_id = null )

Get list of users from Zoom.


Parameters

$account_id

(null|string) (Optional) The account id to use to get the users with.

Default value: null


Top ↑

Return

(TribeEventsVirtualMeetingsZoomarray<string,mixed>) An array of users from Zoom.


Top ↑

Source

File: src/Tribe/Meetings/Zoom/Users.php

	public function get_users( $account_id = null ) {
		$api = $this->api;
		if ( $account_id ) {
			$api->load_account_by_id( $account_id );
		} else {
			$api->load_account();
		}

		if ( empty( $this->api->is_ready() ) ) {
			return [];
		}

		/** @var \Tribe__Cache $cache */
		$cache    = tribe( 'cache' );
		$cache_id = 'events_virtual_meetings_zoom_users' . md5( $this->api->id );

		/**
		 * Filters the time in seconds until the Zoom user cache expires.
		 *
		 * @since 1.4.0
		 *
		 * @param int     The time in seconds until the user cache expires, default 1 hour.
		 */
		$expiration = apply_filters( 'tribe_events_virtual_meetings_zoom_user_cache', HOUR_IN_SECONDS );
		$users      = $cache->get( $cache_id );

		if ( ! empty( $users ) ) {
			return $this->encryption->decrypt( $users, true );
		}

		$available_hosts = $api->fetch_users();
		$cache->set( $cache_id, $this->encryption->encrypt( $available_hosts, true ), $expiration );

		return $available_hosts;
	}

Top ↑

Changelog

Changelog
Version Description
1.5.0 - Add support for multiple accounts.
1.4.0 Introduced.