Initialize cache object for a resource type
**NOTE** `self` MUST be used not `static` when accessing `$cache` object
@param string $type Resource type
496225
protected static function initializeCache($type)
    {
        if (self::$cache === null) {
            self::$cache = new \stdClass();
        }

        if (!property_exists(self::$cache, $type)) {
            self::$cache->{$type} = new \stdClass();
        }
    }
1020910
public function setType(Type $type = null)
    {
        if ($this->type !== $type) {
            $this->type = $type;
        }

        return $this;
    }
1044179
public function flush($type) {
		if (isset($this->cache[$type])) $this->cache[$type]=array();
		return $this;
	}
430649
public function setCache($type, array $options = array())
    {
        $this->cacheType = $type;
        $this->cacheOptions = $options;

        return $this;
    }
1009926
public function setType($type)
    {
        if (strlen($type) == 0) {
            throw new \InvalidArgumentException(sprintf('MIME type should not be empty'));
        }

        if (!preg_match('@^[^/]+/[^/]+$@', $type)) {
            throw new \InvalidArgumentException(sprintf('Invalid MIME type: %s', $type));
        }

        $this->type = $type;

        return $this;
    }
344802
public function init()
	{
		// generic driver initialisation
		parent::init();

		if ($this->memcached === false)
		{
			// do we have the PHP memcached extension available
			if ( ! class_exists('Memcached') )
			{
				throw new \FuelException('Memcached sessions are configured, but your PHP installation doesn\'t have the Memcached extension loaded.');
			}

			// instantiate the memcached object
			$this->memcached = new \Memcached();

			// add the configured servers
			$this->memcached->addServers($this->config['servers']);

			// check if we can connect to the server(s)
			if ($this->memcached->getVersion() === false)
			{
				throw new \FuelException('Memcached sessions are configured, but there is no connection possible. Check your configuration.');
			}
		}
	}
716246
public function load($resource, $type = null)
    {
        $configs = Yaml::parse($resource);

        return $this->createSchemas($configs);
    }
901989
public function setType(string $type):self
    {
        if (!isset($this->types[$type])) {
            Checkers::notice('Unknown response type [' . $type . ']');
        } else {
            $this->type = $type;
        }
        return $this;
    }
192023
public function addType($type)
    {
        if (!in_array($type, $this->validTypes())) {
            throw new InvalidArgumentException(
                sprintf('Invalid cache type: "%s"', $type)
            );
        }

        $this->types[$type] = true;
        return $this;
    }
949093
public function setResourceType(ResourceType $resourceType)
    {
        $this->iteratorName = '$' . $resourceType->getName();
        $this->resourceType = $resourceType;
    }
986411
public function asType(Type $type)
    {
        if ($this->nullable) {
            $type = $type->nullable();
        }

        $this->invokeCallback($type);

        if ($this->indexName) {
            if ($this->isUnique) {
                $this->definition->unique($this->indexName)->on($this->name);
            } else {
                $this->definition->index($this->indexName)->on($this->name);
            }
        }
    }
849556
public function registerAsSingleton(string $type): self
    {
        $this->typeDefinition->register($type, true);
        return $this;
    }
1078679
public static function getInstance($type, $init)
    {
        if (!self::$cachingInstance) {
            self::$cachingInstance = new MemcachedCache($type, $init);
        }

        return self::$cachingInstance;
    }
320275
private static function makeCachedType($key) {
        if (!isset(self::$typeCache[$key])) {
            self::$typeCache[$key] = new Type($key);
        }
        return self::$typeCache[$key];
    }
959223
protected static function init(string $type = 'string', string $key = null, string $name = null)
    {
        $instance = new static();

        $instance->key($key);
        $instance->field['type'] = $type;

        if ($name) $instance->field['name'] = $name;

        return $instance;
    }
458051
public function withType(string $type): self
    {
        $this->type = IdentityProviderEnum::ensureValid($type);
        return $this;
    }
996981
public static function factory($init, $type) 
    {
        
    	$object  = false;
        $wrapper = preg_replace(
			'/\W+/m', 
			null, 
			ucfirst($init->config['Caching']['caching'])
		);
        $class   = 'IDS_Caching_' . $wrapper;
        $path    = dirname(__FILE__) . DIRECTORY_SEPARATOR . 
            $wrapper . '.php';

        if (file_exists($path)) {
            include_once $path;

            if (class_exists($class)) {
                $object = call_user_func(array($class, 'getInstance'), 
                    $type, $init);
            }
        }

        return $object;
    }