Return a ORM cache driver node for an given entity manager

@param string $name

@return ArrayNodeDefinition
327983
private function getOrmCacheDriverNode($name)
    {
        $treeBuilder = new TreeBuilder($name);

        if (method_exists($treeBuilder, 'getRootNode')) {
            $node = $treeBuilder->getRootNode();
        } else {
            // BC layer for symfony/config 4.1 and older
            $node = $treeBuilder->root($name);
        }

        $node
            ->addDefaultsIfNotSet()
            ->beforeNormalization()
                ->ifString()
                ->then(static function ($v) : array {
                    return ['type' => $v];
                })
            ->end()
            ->beforeNormalization()
                ->ifTrue(static function ($v) : bool {
                    return is_array($v) && array_key_exists('cache_provider', $v);
                })
                ->then(static function ($v) : array {
                    return ['type' => 'provider'] + $v;
                })
            ->end()
            ->children()
                ->scalarNode('type')->defaultValue('array')->end()
                ->scalarNode('id')->end()
                ->scalarNode('pool')->end()
                ->scalarNode('host')->end()
                ->scalarNode('port')->end()
                ->scalarNode('database')->end()
                ->scalarNode('instance_class')->end()
                ->scalarNode('class')->end()
                ->scalarNode('namespace')->defaultNull()->end()
                ->scalarNode('cache_provider')->defaultNull()->end()
            ->end();

        return $node;
    }
802326
protected function retrieveTag($name)
    {
        $tag = $this->objectManager->getRepository('IcapBlogBundle:Tag')->findOneByName($name);

        if (!$tag) {
            //let's look if it's scheduled for an Insert...
            $tag = $this->getTagFromIdentityMapOrScheduledForInsert($name);

            if (!$tag) {
                $tag = new Tag();
                $tag->setName($name);
                $this->objectManager->persist($tag);
            }
        }

        return $tag;
    }
108256
public function get($name)
    {
        $value = $this->cache->get($name);

        return is_array($value)
            ? new Location($value)
            : null;
    }
202730
public function getMapping($name)
    {
        if ($mappings = $this->getMappings()) {
            
            if (isset($mappings[$name])) {
                return $mappings[$name];
            }
            
        }
    }
298039
protected function getConnector($name)
    {
        $config = isset($this->drivers[$name]) ? $this->drivers[$name] : false;

        if ($config === false) {
            throw new InvalidArgumentException(
                "Unregistered cache driver name '$name'"
            );
        }

        if (!isset($this->connectors[$name])) {
            if (!is_subclass_of($config['connector'], Connector::class)) {
                throw new InvalidArgumentException(
                    $config['connector'] . ' must implement of ' . Connector::class
                );
            }

            $connector = new $config['connector']($config);

            $this->connectors[$name] = $connector;
        }

        return $this->connectors[$name];
    }
356210
public function findOneByName($name)
    {
        $entityClass = $this->getEntityClass();

        return $this->getObjectManager()
                    ->getRepository($entityClass)
                    ->findOneByName($name);
    }
456734
public function getManyToManyField($name)
    {
        $field = $this->getField($name);

        return $field instanceof ManyToManyField ? $field : null;
    }
1183810
private static function getConnectionConfiguration($name)
    {
        $databaseConfig = Configuration::get('database.connections');
        if (isset($databaseConfig[$name])) {
            $databaseConfig = $databaseConfig[$name];
        } else {
            $databaseConfig = null;
        }

        if ($databaseConfig === null) {
            throw new ConfigurationException("Database configuration for connection '" . $name . "' doesn't exists!");
        }

        if (! isset($databaseConfig['driver'])) {
            throw new ConfigurationException("Database configuration for connection '" . $name . "' is invalid!");
        }

        return $databaseConfig;
    }
706875
public static function get(string $name, ...$params) {
        if (AppContainer::isAutoLoad()) return self::getAutoLoad($name, $params);

        $map = self::getInstance();
        if (!$map->containsKey($name)) {
            return null;
        }
        /** @var Node $node */
        $node = $map->getNodeByKey($name);
        if (null === $node) {
            return null;
        }
        return $node->getValue()($params);
    }
614346
public function getConnectionConfig(string $name = null) {

        // Lookup the connection config
        $config = $this->config->get($this->getConfigName().'.disk');

        // Add cache info the config
        if ($this->config->get($this->getConfigName().'.cache')) {
            $config['cache'] = $this->getCacheConfig();
        }

        // Use the driver as the name.
        $config['name'] = $config['driver'];

        // Return adapter config in the format GrahamCampbell/Flysystem expects
        return $config;
    }
1213223
final public function getCache($name) {
	
		return ((is_array($this->cache) and array_key_exists($name, $this->cache)) ? $this->cache[$name] : NULL);
	
	}
1283878
public function findByName($name)
    {
        return $this->getEntityManager()
            ->createQuery('SELECT r FROM GloobyTaskBundle:Schedule r WHERE r.name = :name')
            ->setParameter('name', $name)
            ->useQueryCache(true)
            ->getSingleResult();
    }
1029960
public function getPdo($name)
    {
        if (!isset($this->connections[$name])) {
            $name   = $this->defaultPdoName;
        }

        if (isset($this->pdoArray[$name])) {
            return $this->pdoArray[$name];
        }

        $pdo                    = $this->createPdo($this->connections[$name]);
        $this->pdoArray[$name]  = $this->initOptions($pdo);
        return $this->pdoArray[$name];
    }
1336992
public static function getInstance(string $name): \Swoole\Table
    {
        if(!static::$isInited)
        {
            throw new \RuntimeException('getInstance failed, MemoryTableManager is not initialized');
        }
        if(!isset(static::$tables[$name]))
        {
            throw new \RuntimeException(sprintf('GetInstance failed, %s is not found', $name));
        }
        return static::$tables[$name];
    }
331871
protected function getMeta(string $name = null): array
    {
        return self::query($this->db->createDesc($name ? $name : $this->tableName));
    }
931175
public static function create($name = 'null') {
    $is_upper = FormatterFactory::getDefaultFormatter()->getConfig('boolean_null_upper');
    $node = new NullNode();
    $node->addChild(NameNode::create($is_upper ? 'NULL' : 'null'), 'constantName');
    return $node;
  }
99154
public function driver(?string $name = null)
    {
        $name = $name ?: $this->getDefaultDriver();

        return $this->drivers[$name] = $this->get($name);
    }