src/Hametuha/GapiWP/Service/Analytics.php
public function get_accounts(){
		static $ga_accounts = null;
		if( !is_null($ga_accounts) ){
			return $ga_accounts;
		}
		$ga_accounts = array();
		if( $this->ga ){
			try{
				$accounts = $this->ga->management_accounts->listManagementAccounts();
				if( count($accounts->getItems()) > 0 ){
					$ga_accounts = $accounts;
				}
			}catch (\Exception $e){
				// Do nothing.
				error_log($e->getMessage(), $e->getCode());
			}
		}
		return $ga_accounts;
	}
public function get_accounts(){
		static $ga_accounts = null;
		if( !is_null($ga_accounts) ){
			return $ga_accounts;
		}
		$ga_accounts = array();
		if( $this->ga ){
			try{
				$accounts = $this->ga->management_accounts->listManagementAccounts();
				if( count($accounts->getItems()) > 0 ){
					$ga_accounts = $accounts;
				}
			}catch (\Exception $e){
				// Do nothing.
				error_log($e->getMessage(), $e->getCode());
			}
		}
		return $ga_accounts;
	}
public function get_accounts ( ) { static $ ga_accounts = null ; if ( ! is_null ( $ ga_accounts ) ) { return $ ga_accounts ; } $ ga_accounts = array ( ) ; if ( $ this -> ga ) { try { $ accounts = $ this -> ga -> management_accounts -> listManagementAccounts ( ) ; if ( count ( $ accounts -> getItems ( ) ) > 0 ) { $ ga_accounts = $ accounts ; } } catch ( \ Exception $ e ) { // Do nothing. error_log ( $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } } return $ ga_accounts ; }
Get account list

@return array|\Google_Service_Analytics_Accounts
Get account list