Put all key types of $type into cache

@param string $class
@param KeyValueType $type
427876
protected function putAllIntoCache($class, KeyValueType $type)
    {

        $this->classCache[$class] = $type;

        foreach ($type as $key=>$keyType) {

            $this->putIntoCache($class, $key, $keyType);

            if ($keyType instanceof ObjectType && $keyType->class) {
                $this->classCache[$keyType->class] = $keyType;
            }

            if (!$keyType instanceof HasTypedItems) {
                continue;
            }

            $itemType = $keyType->itemType;

            if ($itemType instanceof ObjectType && $itemType->class) {
                $this->classCache[$itemType->class] = $itemType;
            }

        }
    }
17313
public static <K,T> Cache2kBuilder<K,T> of(Class<K> _keyType, Class<T> _valueType) {
    return new Cache2kBuilder<K, T>(CacheTypeCapture.of(_keyType), CacheTypeCapture.of(_valueType));
  }
538733
public void cacheClassInfo( String name, Class<?> value ) {
        if ( value != null ) {
            absoluteClassCache.put(name, value);
            // eagerly start the member cache
            memberCache.init(value);
        }
        else
            absoluteNonClasses.add( name );
    }
1152634
public function bind($key, $value, $type = self::TYPE_DEFAULT)
    {
        // Check if locked
        if (isset($this->locked[$key])) {
            throw new \RuntimeException('Cannot override locked content "'. $key .'".');
        }

        // Check if value should be validated
        if (isset($this->validators[$key])) {
            $value = $this->validators[$key]->validate($value);
        }

        // Save key, type and value
        $this->keys[$key] = true;
        $this->types[$key] = $type;
        $this->raw[$key] = $value;
    }
1128145
protected function cacheDatabaseFields($class)
    {
        // Skip if already cached
        if (isset($this->databaseFields[$class]) && isset($this->compositeFields[$class])) {
            return;
        }
        $compositeFields = array();
        $dbFields = array();

        // Ensure fixed fields appear at the start
        $fixedFields = DataObject::config()->uninherited('fixed_fields');
        if (get_parent_class($class) === DataObject::class) {
            // Merge fixed with ClassName spec and custom db fields
            $dbFields = $fixedFields;
        } else {
            $dbFields['ID'] = $fixedFields['ID'];
        }

        // Check each DB value as either a field or composite field
        $db = Config::inst()->get($class, 'db', Config::UNINHERITED) ?: array();
        foreach ($db as $fieldName => $fieldSpec) {
            $fieldClass = strtok($fieldSpec, '(');
            if (singleton($fieldClass) instanceof DBComposite) {
                $compositeFields[$fieldName] = $fieldSpec;
            } else {
                $dbFields[$fieldName] = $fieldSpec;
            }
        }

        // Add in all has_ones
        $hasOne = Config::inst()->get($class, 'has_one', Config::UNINHERITED) ?: array();
        foreach ($hasOne as $fieldName => $hasOneClass) {
            if ($hasOneClass === DataObject::class) {
                $compositeFields[$fieldName] = 'PolymorphicForeignKey';
            } else {
                $dbFields["{$fieldName}ID"] = 'ForeignKey';
            }
        }

        // Merge composite fields into DB
        foreach ($compositeFields as $fieldName => $fieldSpec) {
            $fieldObj = Injector::inst()->create($fieldSpec, $fieldName);
            $fieldObj->setTable($class);
            $nestedFields = $fieldObj->compositeDatabaseFields();
            foreach ($nestedFields as $nestedName => $nestedSpec) {
                $dbFields["{$fieldName}{$nestedName}"] = $nestedSpec;
            }
        }

        // Prevent field-less tables with only 'ID'
        if (count($dbFields) < 2) {
            $dbFields = [];
        }

        // Return cached results
        $this->databaseFields[$class] = $dbFields;
        $this->compositeFields[$class] = $compositeFields;
    }
751291
public function setIoClass($class)
  {
    $prev = $this->configuration['io_class'];
    if (!isset($this->configuration['classes'][$class]) &&
        isset($this->configuration['classes'][$prev])) {
      $this->configuration['classes'][$class] =
          $this->configuration['classes'][$prev];
    }
    $this->configuration['io_class'] = $class;
  }
201846
protected function cacheDatabaseIndexes($class)
    {
        if (!array_key_exists($class, $this->databaseIndexes)) {
            $this->databaseIndexes[$class] = array_merge(
                $this->buildSortDatabaseIndexes($class),
                $this->cacheDefaultDatabaseIndexes($class),
                $this->buildCustomDatabaseIndexes($class)
            );
        }
    }
1362896
public function set_caching($type)
    {
        if ($type) {
            $this->caching = $type;
        }
        else {
            if ($this->cache) {
                $this->cache->close();
            }
            $this->cache   = null;
            $this->caching = false;
        }
    }
1005832
public function clearUpdatedAtCache($class)
    {
        $key = $this->getUpdatedAtCacheKey($class);

        if (!$key) {
            return;
        }

        $cache = $this->getContainer()->get('cache.app');

        $cache->deleteItem($key);
    }
1332630
public function afterCompile(ClassType $class)
	{
		$initialize = $class->getMethod('initialize');
		$initialize->addBody('$proxyAutolader = (new Doctrine\Common\Proxy\Autoloader)->register(?, ?);', [
			$this->config['proxyDir'],
			$this->config['proxyNamespace']
		]);
		$initialize->addBody('Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(\'class_exists\');');

		$initialize->addBody('$subscribers = $this->findByType(?);', ['\Doctrine\Common\EventSubscriber']);
		$initialize->addBody('foreach ($subscribers as $subscriber) { $this->getService(?)->addEventSubscriber($this->getService($subscriber)); }', [$this->prefix('eventManager')]);
	}
632350
public function set($key, $value, $type=null) {
		if($type === null)
			$res = serialize($value);
		else {
			$res = serialize(array(
				'_dataType' => $type,
				'input' => $this->types[$type][0]($value)
			));
		}
		$dal = $this->db->dal();
		if(!$dal->from($this->getTable())->where('key', $key)->update(array('value'=>$res)))
			$dal->into($this->getTable())->insert(array('key'=>$key, 'value'=>$res));
	}
740696
protected function setClass($class): void
    {
        // @todo fix logic about storing the classname
        $this->className = $class;
        if (is_object($class)) {
            $this->className = get_class($class);
        }
        $this->class = new ReflectionClass($class);
    }
430649
public function setCache($type, array $options = array())
    {
        $this->cacheType = $type;
        $this->cacheOptions = $options;

        return $this;
    }
109330
public function addType($name, $class)
    {
        if (!Type::hasType($name)) {
            Type::addType($name, $class);
        } else {
            Type::overrideType($name, $class);
        }
    }
418267
public function mapManyEmbedded(ClassMetadata $class, $type = Type::LIST_)
    {
        $this->embedded = true;
        $this->type     = $type;

        $this->mapAttribute($class);
    }
921636
protected static function CachePublicGettersAndSettersProperties(string $class) : void
    {
        if (
            is_a($class, AbstractDaftObject::class, true) &&
            DefinitionAssistant::IsTypeUnregistered($class)
        ) {
            /**
            * @psalm-var class-string<T>
            */
            $class = DefinitionAssistant::RegisterAbstractDaftObjectType($class);
        }

        foreach (
            DefinitionAssistant::ObtainExpectedProperties($class) as $prop
        ) {
            static::CachePublicGettersAndSettersProperty($class, $prop);
        }
    }
251729
public static function registerType(string $type, string $class): void
    {
        if (isset(static::$types[$type])) {
            throw new ConfigException("Can not register database type={$type} when it was already registered");
        }

        static::$types[$type] = $class;
    }