Obtain the config for a named class
@param string $class The class to get the config for
@return \Weasel\JsonMarshaller\Config\ClassMarshaller The config, or null if not found
174327
public function getConfig($class)
    {
        $class = ltrim($class, '\\');
        $file = $this->configFile;
        if (!isset(self::$_bootstrapConfig[$file])) {
            $this->_buildBootstrapConfig();
        }
        return isset(self::$_bootstrapConfig[$file][$class]) ? self::$_bootstrapConfig[$file][$class] : null;
    }
1329908
public function create($class) {
        $reflectionClass = new ReflectionClass($class);
        $reflectionMethod = $reflectionClass->getConstructor();
        if (!$reflectionMethod) {
            return new $class;
        }
        $params = &$this->fetchDepsFromSignature($reflectionMethod);
        return $reflectionClass->newInstanceArgs($params);
    }
597379
public function fetchAllObj(string $class = null): array
    {
        if ($class == null && $this->modelClass !== null) {
            return parent::fetchAllObj($this->modelClass);
        } else {
            return parent::fetchAllObj($class);
        }
    }
860407
protected function getBinding($class)
    {
        if ($this->isCollection($class) && ! $class->isEmpty()) {
            return $this->getBindingFromCollection($class);
        }

        $class = is_object($class) ? get_class($class) : $class;

        if (! $this->hasBinding($class)) {
            throw new RuntimeException('Unable to find bound transformer for "'.$class.'" class.');
        }

        return $this->bindings[$class];
    }
719023
public function loadClass(string $class)
    {
        if (strpos($class, 'Proxy\__Transactional__\\') !== 0) {
            return null;
        }

        if ($file = $this->findProxyFile($class)) {
            require_once $file;

            return true;
        }

        return null;
    }
267814
public function fetchFirstObj(string $class = null): ?object
    {
        if ($class == null && $this->modelClass !== null) {
            return parent::fetchFirstObj($this->modelClass);
        } else {
            return parent::fetchFirstObj($class);
        }
    }
1141870
public static function get($class)
    {
        $key = strtolower($class);

        if (isset(static::$instances[$key])) {
            return static::$instances[$key];
        }

        static::override($class);

        if (!class_exists($class)) {
            throw new ReflectionException("Class $class does not exist");
        }

        $instance = static::getInstance($class);
        static::register($class, $instance);
        return $instance;
    }
1000621
private function getName($class)
    {
        $class = preg_replace('/(.*[^\\\]+)Interface$/', '$1', $class);

        if (isset($this->entityOverride[$class])) {
            $class = $this->entityOverride[$class];
        }
        if ($this->sectionConfig->hasSection($class)) {
            return $this->sectionConfig->getSection($class)->getAlias();
        }

        return $this->objectNamer->name($class);
    }
1086889
public function getProperties(string $class){
        if(!class_exists($class)){
            throw new \InvalidArgumentException();
        }

        if(!array_key_exists($class, $this->props)){
            $this->props[$class]    = $this->getClass($class)->getProperties();
        }

        return $this->props[$class];
    }
253839
public static function getClass($class) {
        $cache = null;

        if (is_object($class)) {
            $cache = new Cache('gcs_cache_annotation_' . strtolower(str_replace('\\', '-', get_class($class))), 0);
        }
        else {
            $cache = new Cache('gcs_cache_annotation_' . strtolower(str_replace('\\', '-', $class)), 0);
        }

        if ($cache->isExist() && Config::config()['user']['debug']['environment'] != 'development') {
            return $cache->getCache();
        }

        $data = ['class' => [], 'methods' => [], 'properties' => []];

        $reflectionClass = new \ReflectionClass($class);

        //Class annotations
        $parser = new Parser($reflectionClass->getDocComment());
        $dataClasses = $parser->parse();

        foreach ($dataClasses as $key => $dataClass) {
            $processorClass = new Processor($dataClass);
            array_push($data['class'], [0 => ['annotation' => $dataClass['type'], 'instance' => $processorClass->process()]]);
        }

        //Method annotations
        $methodsName = $reflectionClass->getMethods();

        foreach ($methodsName as $methodName) {
            $method = new \ReflectionMethod($class, $methodName->getName());

            $parser = new Parser($method->getDocComment());
            $dataMethods = $parser->parse();

            if (count($dataMethods) > 0) {
                $data['methods'][$methodName->getName()] = [];

                foreach ($dataMethods as $key => $dataMethod) {
                    $processorMethods = new Processor($dataMethod);
                    array_push($data['methods'][$methodName->getName()], ['annotation' => $dataMethod['type'], 'instance' => $processorMethods->process()]);
                }
            }
        }

        //Properties annotations
        $propertiesNames = $reflectionClass->getProperties();

        foreach ($propertiesNames as $propertyName) {
            $property = new \ReflectionProperty($class, $propertyName->getName());

            $parser = new Parser($property->getDocComment());
            $dataProperties = $parser->parse();

            if (count($dataProperties) > 0) {
                $data['properties'][$propertyName->getName()] = [];

                foreach ($dataProperties as $key => $dataProperty) {
                    $processorProperties = new Processor($dataProperty);
                    array_push($data['properties'][$propertyName->getName()], ['annotation' => $dataProperty['type'], 'instance' => $processorProperties->process()]);
                }
            }
        }

        $cache->setContent($data);
        $cache->setCache();

        return $data;
    }
110631
public static function getConstantValue($class, $constant)
    {
        $reflection = new \ReflectionClass($class);

        if (self::hasConstant($class, $constant)) {
            return $reflection->getConstant($constant);
        }

        return null;
    }
495264
public function forClass(string $class): array
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException("Cannot get meta for non-exist class '$class'");
        }

        $reflection = $this->factory->reflectClass($class);

        $meta = $this->getClassMeta($reflection);
        $meta['@properties'] = $this->getPropertiesMeta($reflection);

        return $meta;
    }
227122
public static function get_extra_config($class)
    {
        $config = Config::inst();
        $classConfig = $config->get($class, null, Config::EXCLUDE_EXTRA_SOURCES);
        $extensionConfig = $config->get(static::class);
        $extraConfig = [];

        foreach (static::CONFIG_SETTINGS_WITH_DEFAULTS as $setting) {
            if (isset($classConfig[$setting]) && !is_array($extensionConfig[$setting])) {
                $extraConfig[$setting] = $classConfig[$setting];
            } else {
                $extraConfig[$setting] = $extensionConfig[$setting];
            }
        }

        return $extraConfig;
    }
1250884
protected static function getSingleton($class = null)
    {
        //super magic sauce getting the callers class
        if (is_null($class) && function_exists('get_called_class')) {
            $class = get_called_class();
        }
        
        //get routed class, if any
        $class = Route::i()->get($class);
        
        //if it's not set
        if (!isset(self::$instances[$class])) {
            //set it
            self::$instances[$class] = self::getInstance($class);
        }
        
        //return the cached version
        return self::$instances[$class];
    }
816798
protected function findMetadata($class)
    {
        $metadata = null;

        try {
            // We could not use the hasMetadataFor() method as it is not working if the entity is not loaded. But
            // the getMetadataFor() method could throw an exception if the class is not found
            $metadata = $this->entityManager->getMetadataFactory()->getMetadataFor($class);
        } catch (Exception $exception) {
            // If an exception is raised, nothing to do. Extra data from metadata will be not used.
        }

        return $metadata;
    }
130361
public function resolveClass( $class )
	{
		if ( !is_string( $class ) )
			throw new ResolverException( "Class must be a string" );

		// Check if a class has been mapped to a key
		if ( array_key_exists( $class, $this->classAlias ) )
			try
			{
				return $this->resolve( null, $this->classAlias[$class] );
			}
			catch ( ResolverException $e )
			{
				// Ignore
			}

		// Check if the class has been initialized
		foreach ( $this->instances as $instance )
			if ( get_class( $instance ) == $class )
				return $instance;

		// TODO Other methods to check?

		return false;
	}
721344
final public static function getInstance($calledClass = null)
    {
        $calledClass = $calledClass ?: get_called_class();

        if (!isset(self::$instances[ $calledClass ])) {
            self::$instances[ $calledClass ] = new $calledClass();
        }

        return self::$instances[ $calledClass ];
    }