src/Traits/HasInstances.php
public static function instance($id)
	{
		$class = get_called_class();

		if (empty(static::$instances[$class][$id]))
		{
			static::$instances[$class][$id] = new static($id);
		}

		return static::$instances[$class][$id];
	}
public static function instance($id)
	{
		$class = get_called_class();

		if (empty(static::$instances[$class][$id]))
		{
			static::$instances[$class][$id] = new static($id);
		}

		return static::$instances[$class][$id];
	}
public static function instance ( $ id ) { $ class = get_called_class ( ) ; if ( empty ( static :: $ instances [ $ class ] [ $ id ] ) ) { static :: $ instances [ $ class ] [ $ id ] = new static ( $ id ) ; } return static :: $ instances [ $ class ] [ $ id ] ; }
Create and return a cached instance

@param   integer  $id  Identifier of the instance

@return  $this
Create and return a cached instance