Look for custom indexes declared on the class

@param  string $class

@return array
@throws InvalidArgumentException If an index already exists on the class
@throws InvalidArgumentException If a custom index format is not valid
189892
protected function buildCustomDatabaseIndexes($class)
    {
        $indexes = [];
        $classIndexes = Config::inst()->get($class, 'indexes', Config::UNINHERITED) ?: [];
        foreach ($classIndexes as $indexName => $indexSpec) {
            if (array_key_exists($indexName, $indexes)) {
                throw new InvalidArgumentException(sprintf(
                    'Index named "%s" already exists on class %s',
                    $indexName,
                    $class
                ));
            }
            if (is_array($indexSpec)) {
                if (!ArrayLib::is_associative($indexSpec)) {
                    $indexSpec = [
                        'columns' => $indexSpec,
                    ];
                }
                if (!isset($indexSpec['type'])) {
                    $indexSpec['type'] = 'index';
                }
                if (!isset($indexSpec['columns'])) {
                    $indexSpec['columns'] = [$indexName];
                } elseif (!is_array($indexSpec['columns'])) {
                    throw new InvalidArgumentException(sprintf(
                        'Index %s on %s is not valid. columns should be an array %s given',
                        var_export($indexName, true),
                        var_export($class, true),
                        var_export($indexSpec['columns'], true)
                    ));
                }
            } else {
                $indexSpec = [
                    'type' => 'index',
                    'columns' => [$indexName],
                ];
            }
            $indexes[$indexName] = $indexSpec;
        }
        return $indexes;
    }
744079
private static function getProperties($class): array
    {
        $reflect = new \ReflectionClass($class);
        $prop = $reflect->getProperties(
            \ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED | \ReflectionProperty::IS_PRIVATE
        );
        $properties = [];
        foreach ($prop as $property) {
            $properties[] = $property->name;
        }
        $parent = \get_parent_class($class);
        if ($parent) {
            $properties = \array_merge(self::getProperties($parent), $properties);
        }
        return $properties;
    }
636246
public function getTraits(string $class){
        if(!class_exists($class)){
            throw new \InvalidArgumentException();
        }

        if(!array_key_exists($class, $this->traits)){
            $traits     = array_map(
                function($v){
                    return false;
                },
                array_flip(class_uses($class))
            );

            do{
                $continue   = false;
                $new        = [];

                foreach($traits as $trait => $flag){
                    if($flag === false){
                        $traits[$trait] = true;

                        foreach(class_uses($trait) as $use){
                            if(!array_key_exists($use, $traits)){
                                $continue   = true;
                                $new[$use]  = false;
                            }
                        }
                    }
                }

                $traits += $new;
            }while($continue === true);

            $this->traits[$class]   = array_keys($traits);
        }

        return $this->traits[$class];
    }
509027
public static function getClassMethods($context, $class) {
        $methods = array();

        foreach ($class->getMethods() as $method) {
            $meta = static::getMeta($method);
            $methods[$meta['name']] = static::scanDependency($context, preg_replace('/public static function (.+)\\(/', "function {$context['funcprefix']}\$1(", $meta['code']), $meta['code']);
        }

        return $methods;
    }
282101
public function findExtends($class) {
        $this->init();

        $fullQualifiedNamespace = $this->trimNamespace($class);

        $phpClasses = [];

        foreach ($this->localCache as $phpClass) {
            if ($fullQualifiedNamespace === $phpClass->getExtends()) {
                $phpClasses[] = $phpClass;
                $phpClasses   = array_merge($phpClasses, $this->findExtends($phpClass->getFullQualifiedNamespace()));
            }
        }

        return $this->arrayUniqueObject($phpClasses);
    }
602565
public function extractName($class)
    {
        foreach ($this->extractors as $extractor) {
            if ($extractor->canExtractName($class)) {
                return $extractor->extractName($class);
            }
        }

        throw new \InvalidArgumentException();
    }
1237484
public function getBasicDefinition($class)
    {
        if (!class_exists($class)) {
            throw new \InvalidArgumentException("$class is not a valid class name");
        }

        $definition = new Definition($class, []);

        $traits = $this->classUsesDeep($class);
        foreach ($traits as $trait) {
            switch ($trait) {
                case 'Smartbox\Integration\FrameworkBundle\DependencyInjection\Traits\UsesEvaluator':
                    $definition->addMethodCall('setEvaluator', [new Reference('smartesb.util.evaluator')]);
                    break;

                case 'Smartbox\Integration\FrameworkBundle\DependencyInjection\Traits\UsesSerializer':
                    $definition->addMethodCall('setSerializer', [new Reference('jms_serializer')]);
                    break;

                case 'Smartbox\Integration\FrameworkBundle\DependencyInjection\Traits\UsesValidator':
                    $definition->addMethodCall('setValidator', [new Reference('validator')]);
                    break;

                case 'Smartbox\Integration\FrameworkBundle\DependencyInjection\Traits\UsesEventDispatcher':
                    $definition->addMethodCall('setEventDispatcher', [new Reference('event_dispatcher')]);
                    break;

                case 'Smartbox\Integration\FrameworkBundle\DependencyInjection\Traits\UsesEndpointFactory':
                    $definition->addMethodCall('setEndpointFactory', [new Reference('smartesb.endpoint_factory')]);
                    break;

                case 'Smartbox\Integration\FrameworkBundle\DependencyInjection\Traits\UsesEndpointRouter':
                    $definition->addMethodCall('setEndpointsRouter', [new Reference('smartesb.router.endpoints')]);
                    break;

                case 'Smartbox\Integration\FrameworkBundle\DependencyInjection\Traits\MessageFactoryAware':
                    $definition->addMethodCall('setMessageFactory', [new Reference('smartesb.message_factory')]);
                    break;

                case 'Smartbox\Integration\FrameworkBundle\DependencyInjection\Traits\UsesCacheService':
                    $definition->addMethodCall('setCacheService', [new Reference('smartcore.cache_service')]);
                    break;

                case 'Symfony\Component\DependencyInjection\ContainerAwareTrait':
                    $definition->addMethodCall('setContainer', [new Reference('service_container')]);
                    break;
            }
        }

        return $definition;
    }
1300925
private static function getMethods($methods, $class): array
    {
        $methods[] = \array_fill_keys(\get_class_methods($class), 0);
        $parent = \get_parent_class($class);
        if ($parent) {
            \array_merge($methods, self::getMethods($methods, $parent));
        }
        return $methods[0];
    }
513789
public function getFunctionCompiler($class)
    {
        if (!isset($this->functionCompilers[ $class ])) {
            $this->functionCompilers[ $class ] = new $class;
            if (!$this->functionCompilers[ $class ] instanceof FunctionCompiler) {
                throw new \InvalidArgumentException(
                    "Class {$class} is not an instance of FunctionCompiler"
                );
            }
        }

        return $this->functionCompilers[ $class ];
    }
1038970
public static function getByClass( $class )
	{
		$results = [];
		foreach ( static::$globals as $k => $v )
			if ( $v instanceof $class )
				$results[$k] = $v;
		return $results;
	}
742123
public function getEntityIdentifiers($class)
    {
        $registry = $this->getService('application.registry', array('key' => $this->getIdentifier()));

        if (!$registry->offsetExists($class.'-identifiers')) {
            $path = ANPATH_ROOT.DS.'components'.DS.'com_'.$this->getIdentifier()->package.DS.'domains'.DS.'entities';

            $identifiers = array();

            if (file_exists($path)) {

                //scandir without . and .. hiident directories
                $files = array_values(preg_grep('/^([^.])/', scandir($path)));

                foreach ($files as $file) {
                    $name = explode('.', basename($file));
                    $name = $name[0];
                    $identifier = clone $this->getIdentifier();
                    $identifier->path = array('domain','entity');
                    $identifier->name = $name;

                    try {
                        if (is($identifier->classname, $class)) {
                            $identifiers[] = $identifier;
                        }
                    } catch (Exception $e) {
                    }
                }
            }

            $registry->offsetSet($class.'-identifiers', $identifiers);
        }

        $identifiers = $registry->offsetGet($class.'-identifiers');

        return $identifiers;
    }
1326693
public function getAncestors($class)
    {
        $ancestors = [];
        while (true) {
            $parent = $this->getParent($class);
            if ($parent) {
                $ancestors[] = $parent;
                $class = $parent;
            } else {
                break;
            }
        }
        return $ancestors;
    }
780664
public function findFile($class)
    {
        return $this->finder->findFile($class, $this->prefixPaths, $this->basePaths, $this->useIncludePath);
    }
916214
private function getEntityTypeInfo($class)
    {
        $entityType = $this->getEntityType($class);

        if (!$entityType) {
            return [null, null];
        }

        $info = entity_get_info($entityType);

        if (!$info) {
            return [null, null];
        }

        return [$entityType, $info];
    }
414550
public function fetchAllObj(string $class = null): array
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        if ($class === null) {
            return $this->getAdapter()->getStatement()->fetchAll(PDO::FETCH_OBJ);
        } else {
            $objects = [];
            foreach ($this->fetchAll() as $record) {
                $objects[] = new $class($record);
            }

            return $objects;
        }
    }
239001
public function getTypesForClass(string $class): array
    {
        $types = array_filter(
            $this->typeMap,
            function ($val) use ($class) {
                return $val === $class;
            }
        );

        if (empty($types)) {
            $error = sprintf('Does not exist any valid type for class "%s"', $class);
            throw new \UnexpectedValueException($error);
        }

        return array_keys($types);
    }
103502
public function getHooks($class)
    {
        $hooks = array();

        foreach (get_class_methods($class) as $method) {
            if (strpos($method, 'hook') === 0) {
                $hooks[] = $method;
            }
        }

        return $hooks;
    }