public static function getInstance($group)
	{
		static $instances;

		// Set instances array
		if (!isset($instances))
		{
			$instances = array();
		}

		// Do we have a matching instance?
		if (!isset($instances[$group]))
		{
			// If an ID is passed, check for a match in existing instances
			if (is_numeric($group))
			{
				foreach ($instances as $instance)
				{
					if ($instance && $instance->get('gidNumber') == $group)
					{
						// Match found
						return $instance;
						break;
					}
				}
			}

			// No matches
			// Create group object
			$hzg = new self();

			if ($hzg->read($group) === false)
			{
				$instances[$group] = false;
			}
			else
			{
				$instances[$group] = $hzg;
			}
		}

		// Return instance
		return $instances[$group];
	}
public static function getInstance($group)
	{
		static $instances;

		// Set instances array
		if (!isset($instances))
		{
			$instances = array();
		}

		// Do we have a matching instance?
		if (!isset($instances[$group]))
		{
			// If an ID is passed, check for a match in existing instances
			if (is_numeric($group))
			{
				foreach ($instances as $instance)
				{
					if ($instance && $instance->get('gidNumber') == $group)
					{
						// Match found
						return $instance;
						break;
					}
				}
			}

			// No matches
			// Create group object
			$hzg = new self();

			if ($hzg->read($group) === false)
			{
				$instances[$group] = false;
			}
			else
			{
				$instances[$group] = $hzg;
			}
		}

		// Return instance
		return $instances[$group];
	}
public static function getInstance ( $ group ) { static $ instances ; // Set instances array if ( ! isset ( $ instances ) ) { $ instances = array ( ) ; } // Do we have a matching instance? if ( ! isset ( $ instances [ $ group ] ) ) { // If an ID is passed, check for a match in existing instances if ( is_numeric ( $ group ) ) { foreach ( $ instances as $ instance ) { if ( $ instance && $ instance -> get ( 'gidNumber' ) == $ group ) { // Match found return $ instance ; break ; } } } // No matches // Create group object $ hzg = new self ( ) ; if ( $ hzg -> read ( $ group ) === false ) { $ instances [ $ group ] = false ; } else { $ instances [ $ group ] = $ hzg ; } } // Return instance return $ instances [ $ group ] ; }
Returns a reference to a group object

@param   mixed  $group  A string (cn) or integer (ID)
@return  mixed  Object if instance found, false if not
Returns a reference to a group object