private function _userids($users)
	{
		$db = \App::get('db');

		if (empty($db))
		{
			return false;
		}

		$usernames = array();
		$userids = array();

		if (!is_array($users))
		{
			$users = array($users);
		}

		foreach ($users as $u)
		{
			if (is_numeric($u))
			{
				$userids[] = $u;
			}
			else
			{
				$usernames[] = $db->quote($u);
			}
		}

		if (empty($usernames))
		{
			return $userids;
		}

		$set = implode($usernames, ",");

		$sql = "SELECT id FROM `#__users` WHERE username IN ($set);";

		$db->setQuery($sql);

		$result = $db->loadColumn();

		if (empty($result))
		{
			$result = array();
		}

		$result = array_merge($result, $userids);

		return $result;
	}
private function _userids($users)
	{
		$db = \App::get('db');

		if (empty($db))
		{
			return false;
		}

		$usernames = array();
		$userids = array();

		if (!is_array($users))
		{
			$users = array($users);
		}

		foreach ($users as $u)
		{
			if (is_numeric($u))
			{
				$userids[] = $u;
			}
			else
			{
				$usernames[] = $db->quote($u);
			}
		}

		if (empty($usernames))
		{
			return $userids;
		}

		$set = implode($usernames, ",");

		$sql = "SELECT id FROM `#__users` WHERE username IN ($set);";

		$db->setQuery($sql);

		$result = $db->loadColumn();

		if (empty($result))
		{
			$result = array();
		}

		$result = array_merge($result, $userids);

		return $result;
	}
private function _userids ( $ users ) { $ db = \ App :: get ( 'db' ) ; if ( empty ( $ db ) ) { return false ; } $ usernames = array ( ) ; $ userids = array ( ) ; if ( ! is_array ( $ users ) ) { $ users = array ( $ users ) ; } foreach ( $ users as $ u ) { if ( is_numeric ( $ u ) ) { $ userids [ ] = $ u ; } else { $ usernames [ ] = $ db -> quote ( $ u ) ; } } if ( empty ( $ usernames ) ) { return $ userids ; } $ set = implode ( $ usernames , "," ) ; $ sql = "SELECT id FROM `#__users` WHERE username IN ($set);" ; $ db -> setQuery ( $ sql ) ; $ result = $ db -> loadColumn ( ) ; if ( empty ( $ result ) ) { $ result = array ( ) ; } $ result = array_merge ( $ result , $ userids ) ; return $ result ; }
Get a list of user IDs from a string, list, or list of usernames

@param   array  $users
@return  mixed
Get a list of user IDs from a string list or list of usernames